?
Afghanistan was a base of operations for a group you may have heard of - Al-Qaeda. You may have heard of the 1993 World Trade Center attack, or maybe the Bojinka Plot, or the 1998 embassy bombings, or the USS Cole attack. Plus there was this little event on September 11, 2001.
You'll notice that we have not been attacked since we invaded. Giving the enemy a safe place to plan and organize is not a good idea.