Whatever the answer is, I don't think we should let the analysis fall prey to populism. As much as I'd agree that Iraq seems to have been a disaster, and that we haven't managed to accomplish much in Afghanistan, consider the wider implications. The USA has managed to navigate itself to the point where it put significant pressure on Iran through sanctions, has agreed to dismantle its nuclear weapons program, and is beginning to re-enter the global economy amidst a lessening of tensions. Presumably at least partially as a result, the price of oil is down to $40, which is lower than it was in 1985. (Consider where Iran is on the world map relative to Iraq and Afghanistan.) For all we know in the general public, that was the strategic goal the entire time. (Yes, I know, that's probably giving the government too much credit. Then again, consider the skill of sabotage like the Stuxnet virus, and imagine the same skill applied to long-term global strategic thinking.)
Perhaps the empire would be much stronger if not for those blunders, or perhaps Iraq would still be a dictatorship and Iran a nuclear threat. As much as ISIS is annoying, it doesn't seem to be an actual strategic threat in the way that nuclear powers with long-range ballistic missiles are.
Just to be clear, I don't know what to believe. I'm playing devil's advocate and primarily arguing not to prematurely conclude that things are simpler than they seem. Consider, for example, the layers of subtlety involved in executing Nixon's Madman theory: https://en.wikipedia.org/wiki/Madman_theory - given the crazy things that actually have happened in our world and politics, I would not be especially surprised if the government knowingly went to war with Iraq on a pretext, specifically to put pressure on Iran and take geo-political control of the region (perhaps even to destabilize the region), with a "fall guy" planned out ahead of time in the way of "no one really believed there were WMDs". The story that, "We thought they had WMDs and were wrong" is a lot easier for the public and world to accept than, "We are strategically invading Iraq and Afghanistan to put pressure on Iran."
Granted, I agree with you that these situations are total clusterfucks. I'm just saying let's look beneath the surface.