All of the things you're discussing are not things that the US simply didn't bother to try to solve, but we were ultimately powerless to do so. Americans would never tolerate US soldiers dying by the tens to hundreds of thousands as would have happened if we actually tried to enforce order on foot. So we were left with proxy soldiers, contractors, and a money printing machine. But that simply wasn't enough to defeat the Taliban, let alone carry out the grand changes you mention.
I disagree with this assessment.
Had the Western forces provided actual, proven economic opportunities for the people, the supply of "resistance" fighters would have dwindled. People don't become terrorists or insurgents just because, they follow that path because they do not see a gainful alternative to this life. (Side note, we're seeing this also in Palestine where Hamas and Fatah both draw a steady supply of recruits from the desperate)
Afghanistan has untold billions of dollars worth of all kinds of natural resources [1]. But no attempt was made, not even on paper, to exploit these natural resources. IMHO, even a single pilot project would have been a good start - a mine that pays a decent amount of money to the workers and the profits going to the national government as well as local authorities. Basically, show to the wide population that something good came around from all the suffering in the end, provide an alternative from the Taliban propaganda that at least promised salvation in the afterlife for killing infidels.
But no, we ignored this opportunity, which meant that other than "women can go to schools" we did not have any talking points available to counter the Taliban propaganda of "they're killing us with impunity and the puppet government is looting". That is how we truly lost, and what China and a bunch of oil sheiks will now enjoy.
[1] https://globalinitiative.net/analysis/why-is-afghanistan-par...
Germany used to be the same until 1871, a loose federation of fiefdoms that regularly went to war amongst each other. Fun fact, the tariff region structure [1] very much resembles a map from what was "Germany" before then [2].
It's not impossible to turn a bunch of small fiefdoms into one powerful entity. All you need is a compelling story and, as I wrote in this thread, some sort of economic incentive/perspective that actually shows to the population that the new government is actually better for their individual lives than what was before.
[1] https://www.reddit.com/r/de/comments/c18q0r/das_heilige_tari...
[2] https://de.wikipedia.org/wiki/Datei:Heiliges_R%C3%B6misches_...
The Soviets wanted Afghanistan for imperialist reasons, during the first Taliban era there were enough other sources that were more convenient, the Americans lacked the conviction and coherence to follow through... and now the Chinese are swooping in with money.
The problem is, in Afghanistan the Western nations didn't do much else than depose the Taliban that took around two years and provide education abilities for women afterwards. But in order to actually achieve change, you have to invest significantly more resources to actually build the foundations for a viable society: democracy, rule of law and an economic perspective for the populace.
In Germany, the Allied Forces stayed for about 45 years, two generations worth of time. Just think of the massive amount of money and resources invested... the first years were taken similarly to Afghanistan - depose the Hxtler regime and rebuild a rule of law afterwards and, as in the Luftbrücke, ensure basic survival. But then, they stayed in for over three decades to make sure that a healthy democracy would not just form but also establish and entrench itself against threats, and that Germany had an industrial base which was used to provide employment and income for the populace. Also, thank God for the Americans deciding not to follow the "Morgenthau plan" that proposed turning Germany into a purely agrarian state with no industrial capability ever again - that would have caused us to follow down the Afghanistan path with utter certainty.
In Afghanistan however, the situation after the immediate war and short post-war period was markedly different. The troops were locked up in their bases outside of bombing jihadists, which meant that local warlords had little to no oversight in their atrocities and stuff like "bacha bazi" (organized child sexual abuse) and slavery went on with effective impunity. The local puppet government barely had any income sources other than foreign aid (and selling opium on the black market) which meant there was no way to form a national identity and storytelling or even a common purpose, and a lack of oversight of the occupying forces over the puppet government led to widespread corruption and looting of the external investments, which led to it losing support across the country. And on top of that, we didn't even do decent oversight over our own troops. Abu Ghuraib is far from the only scandal that was barely prosecuted, not to mention all the other shit that was quietly swept under the rug - that led to the populace despising our troops even more.
We didn't lose Afghanistan because the Taliban are a strong army - they were and are not, just look at the videos from right after the takeover. We lost Afghanistan because we didn't give anyone in the wide population a reason to fight for themselves and not just submit to the next best warlord.