Better be careful asking such logical questions. Some people's heads might explode.
>> So why did we take out Iraq who was the enemy of Iran?
A simple enough answer ...
Because BOTH were our enemies, and you have to start somewhere. Having Iraq and Iran, both of which are hostile to the U.S., in a nuclear arms race would not have been good for the U.S or our allies in Israel or Europe - partiuclarly considering that they sit atop a vital oil supply.
Iraq was a less formidible enemy than Iran, had connections to terrorist organizations, and we had reason to believe were producing WMD’s (perhaps we were mistaken, and perhaps not) ... so they got the first wave. Our attack on Iraq immediately brought Libya into line - thus eliminating another enemy state in the process.
Iraq, once stabilized, will provide a sufficient staging ground for further intervention in the region - in Iran, Sudan, or Saudi.
The entire middle east is a mess, and is a threat to the safety and prosperity of the United States. However, as impressive as our military is, we cannot slay all dragons at once. Due to connections with Al Qaeda and broad suspicions of WMD’s, Iraq and Afghanistan drew the short straws.
H