Sunk cost. America gained nothing for those 20 years of blood and treasure, explicitly evidenced by their reversion before we could even leave.
Neocon fantasy of nation building was always a fantasy.
We lost the "War on Terror" because we ended up where it all started -- with the Taliban in full control of Afghanistan.
The Taliban didn't start the 'war on terror', that started because religious fanatics didn't like the presence of U.S. troops in Saudi Arabia. The neocon foreign policy of making Saudi Arabia an imperial outpost by backing a corrupt monarchy provoked the attacks on the U.S.
For over three decades, at every turn the neocons have gotten the U.S. involved in wars that have nothing to do with improving our security.
Another Vietnam, run by old generals, and congress.