Actually the reason why we're "losing" in Iraq is because of unintended consequences. After we overthrew Saddam all the different sectarian groups in Iraq began to kill each other, and warlords of the groups quickly began fighting to take over parts of the country. This is still going on right now and that's why Iraq has become a country inflicted with chaos.
However, if we keep a military base there and control the oil there (Iraq has the second biggest oil reserve in the world) then we can use this for leverage to other countries that are highly dependent on oil, thus this reason may justify the war, it'll just justify it in the long run.