The generals played politics and CYA for twenty years. From Douglas MacGregor at theamericanconservative.com:
President Biden’s decision to withdraw from Afghanistan has produced just the exposure the generals hoped to avoid with Trump’s defeat.
Presidents usually get the generals they want. In the last election, though, the generals got the president they wanted. Or, at least, so they thought.
It’s easy to understand. President Trump was a menace to the generals, especially the four stars in the Army and the Marines. In sharp contrast to his predecessors in the White House, Trump declined to accept unconditionally the generals’ best military advice.
As far as Trump was concerned, the answers he received from his secretaries of Defense and the four stars concerning the need to stay in Afghanistan—to build democracy, liberate women, encircle Iran, keep China out and Russia at bay—did not pass the smell test. For Trump, neither the Russians nor the Chinese were ten feet tall, and Afghanistan’s security was never as important as the security of Rhode Island, Alabama, or Michigan.
In Trump’s view, Afghanistan was never a strategic asset. The country is one of the most remote places on earth. There is no scientific-industrial base. Its geostrategic position affords little advantage in a world dominated by precision guided missiles and space-based intelligence, surveillance, and reconnaissance. The planning and practice for 9/11 was conducted in Germany and the United States, not in Afghanistan.
Long before Trump came to the presidency, Afghanistan was an enduring entanglement with no return on investment. Economically, Afghanistan belongs to sub-Saharan Africa. An American military presence, let alone massive U.S. economic investment in Afghanistan’s society and various peoples, is one of the most extreme examples of wasteful strategic overstretch in human history.