@ossobuco,
We were attacked, we told the Afghan government (then the Taliban) to turn over the perpetrators (bin Laden and Al Qaeda), and they refused. Most of the world at least understood, even if they didn't support us, when we invaded Afghanistan. There was possibility of extirpating the Taliban, and we went boldly into Waziristan, the tribal area straddling the Afghan-Pakistani border. Pakistan was never a willing ally, and Pervez Mushareff told his people on September 12, 2001, that he was being forced into an alliance by American military threat. The administration down-played that, and the western press didn't pay it any attention. ISI, the Pakistani security agency, supported and advised the Taliban in Waziristan, and may even have fought themselves against the Americans. But we still had a good shot at putting the Taliban out of business, and at the least, driving them from the tribal area of southern Afganistan which was their home.
But we had those PNAC shits in power--Cheney, Rumsfeld, Wolfowitz, Perle and many others, and they were just panting to invade Iraq. So we set up a coalition military force in Afghanistan, withdrew from Waziristan, and put the old, bad warlord/druglords back in power who had been driven out by the Taliban. Initially, the Afghans applauded the Taliban because they had put those men out of business--that was before the horror descended on the Afghan people. If they didn't actually applaud our invasion, they certainly didn't care what happened to the Taliban. But then, in our rush to invade Iraq, they saw the hated warlords being put back into power, whose ouster was the one thing about the Taliban they had appreciated. What ever sympathy, whatever political capital we might have had with the Afghans was shot by that. Karzai was a Taliban supporter, until his father was murdered and all the clues pointed to the Taliban. We basically screwed the pooch by that old canard that these were primitive people, not ready for democracy, and we could control them with the strong men who had once ruled Afghanistan in the brief period between the fall of the communist government and the Taliban take-over.
So, just as we have stupidly done for so long over the last 60 years, we attempted a shallow and ill-considered expedient to "settle" Afghanistan before we roared off into Iraq. The result is that the Taliban, once on the ropes, has recovered (not nearly to the point they were at in 2001, but definitely a player again), and the Afghans have no faith in the United States, in NATO or in Karzai's regime.
Other nations have long foreign policy histories from which they can learn, but we don't. All we have is the legacy of the cold war, during which we would support brutal shits like Marcos or Pinochet, so long as they were reliably anti-communist. We've just transferred the principle, and now we are relying on a puppet government in Afghanistan which is ostensibly anti-Taliban, although that is not something of which we can be sure, and a government the people of Afghanistan despair of. Little wonder that it has become a morrass.