Well, that's what a free market is all about -- they sell their oil to the highest bidder. I guess our companies weren't the highest bidders.
Also, keep in mind that most of the people in Iraq have more in common with the folks in Iran than they did with Saddam (who was minority Sunni)-- most in Iraq are Shi'a. When we invaded Iraq in 2003, I thought that was a mistake for a few reasons: 1) Iran (a worse enemy) lost *their* biggest enemy (and we paid for it!) which strengthened Iran, to our detriment; 2) I knew when they said that this would cost $50 billion or whatever that that was sheer bullshit; and 3) I predicted (and still do) that Iran and Iraq would ultimately become close friends because of their Shi'a-ness.
The whole thing was one monumental mistake, that fucked us over in all kinds of different ways. McCain shrieks "the surge worked!" Well, okay, yeah, it did. That helped us turn our horrifyingly disastrous fuckup into a slightly less horrifying disaster. It was a good tactic, but it was reinforcing a terrible strategy. (And no, McCain apparently does *not* know the difference -- which isn't surprising considering he was 894th out of 899 in school. He's dumb as a rock.)