There was never going to be a clean exit from Afghanistan from the moment the US decided to try to nation build there.
People wanted blood after 9/11, and if we were honest with ourselves about who we really are as a country, after Bin Laden got away in Tora Bora we would've leveled Kabul and called it a day, for all the difference it ultimately ended up making. Not saying it would've been right, but it would've accomplished the exact same thing as what 20 years of occupation did, arguably with less blowback, and it could've been done without dragging the rest of our allies into it, but gotta keep up appearances.
It's a health textbook, of course it's stuck in the 1950's