Both you and the parent poster are missing the forest through the trees.
The failure is not in money, training, or conscription. The failure is in not giving the army any reason to fight.
If you don't give a rat's ass about your cause, and there's a serious possibility of defeat, why would you keep fighting?
The problem is that in twenty years, the coalition-supported government failed to make enough of its constituents give a rat's ass about their cause. They might not like the Taliban much, but they seem to prefer to live under them, than die for what is perceived as a corrupt, self-serving, ineffective government.