The book author Sarah Chayes argues that corruption leads to insurgencies or at least normal civilians turning a blind eye to them, why help the government/police when they've been grafting all over the place.
To me it's also clear why the Afghani army gave up, (if it even existed, it's probably like the ghost schools and students): a leader that was (or appeared) clean and inspirational might've been able to generate a sense of national pride, which the soldiers would've fought and died for. But the soldiers probably knew the elites were corrupt scumbags, who wants to die for that? (Unless the embezzled riches tricked down to them...).
Edit: reading your article makes me think of "reality must take precedence over public relations". It's disgusting to see how the US institutions deluded their way into reporting success, it's almost comparable to the legend that said Saddam Hussein probably thought he had a great WMD program, because all his subordinates were too afraid to bring him bad news..
Imperial Japan and Nazi Germany, bad as they were, still had traditions associated with modern civilization. After the war, the infrastructure was devastated, but they had what economists refer to as "human capital"-- experienced engineers, miners, farmers, architects, people in all construction trades, etc. They had the knowledge and the desire to rebuild, and with the Marshall Plan, the money to do it.
The Taliban doesn't want to build/rebuild Afganistan. They want it to remain firmly in the 7th century, albeit with modern weapons. There is certainly human capital in Afganistan, but they face a real uphill battle.
I always lament the trillions spent on war machines and (bad assumption?) very little spent on improving society through education.
People in the US lament the high cost of education here, but I really wonder what would have happened if we had just taken all that money and handed it to the Afghan government with an expectation it needed to be spent on infrastructure or education instead of our military bases. Am I totally wrong to think that's how it went down?