You must have a gene that is inherited to get AS. The gene is HLA-B27. Only about 20% of people that have the gene actually get the disease.
Here is a link to understand the gene.
http://www.labtestsonline.org/understanding/analytes/hla_b27/test.html
I have AS and inherited if from my grandfather.
I had a similar question recently about rheumatoid arthritis. Ankylosing spondylitis has not been found to be associated with agent orange exposure. If you have PTSD, there are studies linking PTSD to an increased incidence of autoimmune conditions. http://www.nyam.org/news/1129.html