Afghanistan is a nation in word and theory only, not reality. Afghanistan is essentially a collection of tribes and warlords so it shouldn’t be shocking that they can’t get their act together to fend of even a collection of rabble like the Taliban.
The US needs to get out and let the anarchy begin. If the Taliban takes control and attacks US interests again we go over there, blow them back into the dark ages destroying all infrastructure, take out their entire leadership and leave again. Trying to enforce a modern nation state on the Afghan people is a waste of our time and money.