The world has fundamentally changed. It fundamentally changed when the Berlin Wall came down and the 'evil empire' ceased to exist. We are engaged around the world whether we like it or not.
There is no question that al-Qaida operatives are currently active in Iraq. A premature exit before the threat they represent has been dealt with would endanger America and the prospects of eventual peace in the Middle East.
Stupidity trumps Machiavelli almost every time when you are looking for an explanation.