My issue is what was our goal in afganistan?
If the goal is to punish the country for 911 in the most brutal manner possible then killing lots of people would do the trick. If the goal is simply to keep them from fucking up again then killing people like that is counter productive. Ultimently I don't think there was a coherent plan to create a functioning government, and even if there was the leadership in washington was too delusional to actually make it work.
There were too many conflicting goals and agendas and none of it based on what could realistically happen on the ground. Realistically our best option was to go in capture Bin Ladin kill him and his leadership and leave, that was more difficult then expected and we fucked up quite a bit.
That still doesn't even tough an important half of the story. The Taliban exist because Pakistan needs islamic theocrats in charge of their western neighbor, as nothing else makes them feel safe on that border when it comes to shitstorms vs India. Especially when the most likely other alternative was Pashtun nationalists who don't like the Durand Line much and would want a piece of Pakistan that happens to be populated with Pashtuns who being fellow Pashtuns may actually be receptive to the concept of Pashtostan. Obviously Pakistan doesn't like this idea at all. And so they fulfill their need with the Taliban, because as fellow islamists they don't care where the formal border is, they are friends anyway, and they share hatred of infidels like India.
To make this more of a mess, USA was relying mostly on Pakistan as "ally" for its logistical route to Afghanistan, cutting which Pakistan would threaten for all sorts of convenient reasons.
This is the main reasons why Pakistan could provide a R&R area and training facilities for Taliban, while also hiding OBL himself, yet despite all that didn't feel much in the way of consequences from USA.
As such, whatever happens in Afghanistan, Pakistan can be assumed to have considerable influence in that (the Taliban are not the most obedient proxy force in the world, but they are a proxy). If they didn't want the Taliban to exist, it wouldn't exist since at least a decade.
If not for Pakistan, US forces would have effectively attritioned the Taliban away. AKA just kill so many of them they don't form a functional force again. But when the Taliban were having bad days like this, they would just retreat over Pakistani border, reinforce from Pakistan's friendly madrassas, and be mostly safe while waiting out the worst because airstrikes over Pakistan were limited by their permissions.
As such, Afghanistan's government had no chance. It was stuck fighting a proxy war against Pakistan, no ifs and buts, while being reliant on allies who couldn't even say it out loud due to how much of a political mess it would be.