The drug trade is a big problem in Afghanistan, but isn't the root cause of the problems there (Indeed, since it's pretty close to the only functioning export industry it may well be a good thing for the farmers).
No-one has ever successfully imposed any system of government on Afghanistan. That reflects deeper causes than the war on drugs.
You rightly state it's a functioning export industry - but the de-facto criminalisation of that industry is the issue. We either need to find ways of either buying the stock for legal uses, or helping people transition to other cash crops. But the industry is supported with 1st world drug users money - and until we address the way our citizens are part of the problem, the problem will remain, or simply move to the next lawless frontier.
Hell, Quebec wants out of Canada and we generally all get along fairly well. Imagine how we'd feel if all the provinces felt the same and were actively and brutally fighting. Why are we trying to hold this mess together?
We've got this manifest destiny thing like we've got to make 1946's border permanent.
A decent job has been done of removing Al Qaeda, but the only way to change a country like Afghanistan is to stop sending millions over there in cash from international drug money. The war on drugs helped fund this situation. And doesn't seem to be helping to bring a resolution yet at great cost to them and us.