I agree with you on the original motives for entering the war. Living in NYC at the time even my furthest left friends were in support of the effort. People were scared and angry, and rightly so.
But I think the shortsighted plan in Iraq is a large part of what has led to our overstay in Afghanistan. America desperately wants to look like the good guy/world police, and after the fiasco that became of Iraq, bailing out on Afghanistan wasn't a face that we wanted to show the world.