armymarinedad gives an excellent answer; I would just like to add a response; or two to your question.
We do not come home now; because the terrorists would declare 'victory'. They would be empowered; embolded and renewed by our 'weakness'; our lack of resolve.
We cannot, in any way, serve the goals of Islamic terrorism.
We stay; and stabilize. . .and we fight like hell to do it, because it is the right thing to do.
. . .and yes, the 'oil thing' is important; important to us, as it is important to our enemies.
In short, we stay, because that is precisely what our terrorist enemies do not want us to do.