Yeah, maybe the actual goals of the terrorists was to make everybody wait longer in airports and getting annoyed? As just revenge for the betrayal of Sykes-Picot and the desecration of the holy lands.
No, the actual goal may have been to increase the visibility of Al Quaeda; serve as a recruitment poster and show that their group can hurt the biggest force on the planet with impunity in a way that can not be denied or spun.
The mantra 'never leave a crisis unused' is enough to explain everything else that followed. Getting the United States out of the middle East was never going to happen as a result of this, rather the opposite and that too would have the effect of driving more people in to the hands of the extremists.
America is about as predictable in this sense as it comes, you can speculate all you want about what would have happened if they had left the Middle East but that universe is not the one we live in.