Yep, we went because we were attacked. Initial plan was to go in, run off the Talibs and then leave. For various reasons, not all readily apparent, we changed the game and decided to stay. Mistake in my view but they didn't ask me. Not only did we decide to stay, we told the Afghans -- and the world -- that we would. In my view, we didn't have to stay but we said we would and so now we have to.
This strategic argument has always intrigued me. After we toppled the Taliban and al-Qaeda and chased them into Pakistan, should we have simply pulled all troops out of Afghanistan and allowed it to collapse back into chaos? What could we have done to ensure that neither returned to power? I think the course of action from 2002-2006 showed that "paying off the warlords", everyone's favorite do-nothing technique, wasn't going to work.