I'm not talking about Iraq either, that's a different (worse) story. The primary victims of the war in afghanistan have been the people of afghanistan, not the Taliban. The world would be a better place if the Taliban ceased to exist, but that doesn't mean that the world will be a better place if we bomb the hell out of the country in order to make the Taliban cease to exist. You gotta look at cost vs benefit.
Also, the war was illegal according to the UN charter (which was ratified by the US and its therefore US law) because nations can only use armed force against other nations for self defense or when approved by the UN security council. Al Qaeda attacked us, not the Taliban, and like I said, we were justified in going against Al Qaeda, not the Taliban.