Apparently, stationing troops in Saudi Arabia, at the host country's request, during the first Gulf War was interpreted by Islamic extremists as "making war on them" or "not letting them be" or something, I guess.
I've come to the conclusion their logic is not our logic. Iran is a theocratic regime still stoning people to death for things that aren't considered criminal in most non-Islamic parts of the world. Saudi Arabia fields morality police and allows teen girls to burn up in a fire rather than flee the building because they weren't dressed appropriately. Honor killings are practiced in most Muslim countries and in some democratic countries with large Muslim populations.
Terrorism is just one manifestation of their whacked out religion. The majority of other Muslims still adhere to and believe in 6th century religious standards and practices that the rest of civilized society has long ago shunned. They cut off body parts, summarily execute prisoners, enslave, deny basic human rights to their own people, and all in the name of their religion.
Islam is one ed up religion. Period.