When U.S. troops complete their exit from Afghanistan, they will leave behind one of the world’s most corrupt and ineffective governments and a population still mired in poverty, illiteracy, and disease.

Should this matter to Americans? After all, the aim of the 2001 invasion was to bring retribution to al-Qaeda, not to lift Afghanistan out of poverty and injustice.

And the Taliban know the consequences of opening the door to al-Qaeda, so will probably keep it shut when they return to power, as they likely will.

Still, we have spent the lives of more than 2,000 American troops and $140 billion of development assistance over almost 20 years. What have we bought?

Almost nothing.

U.S. ambitions in Afghanistan quickly grew after the invasion. Instead of the limited aim of keeping al-Qaeda on the run, we sought to make Afghanistan a showcase – a stable, prosperous democracy in our own image.

But this policy was as short on wisdom as it was long on dollars.

At the peak of aid flow, Afghanistan was receiving more development money than the entirety of its domestic economy. But so much money, under lax supervision, overwhelmed the absorption capacity of such a desperately poor and fractured country.

Foreign aid has brought not democracy to Afghanistan but kleptocracy, a government of thieves.

Malfeasance by Afghan officials is off the charts. About a third of U.S. development aid has vanished through fraud, waste, and abuse, according to a U.S. government watchdog agency, the Special Inspector General for Afghanistan Reconstruction. Afghanistan languishes in the bottom 8 percent in Transparency International’s global corruption scale.

The narcotics industry is a good example: The U.S. spent $9 billion to eradicate it. Up in smoke, as Afghanistan remains the top global producer of opium. The Afghan government does almost nothing to stop the trade. Instead, corrupt officials share an estimated $3 billion in annual opium exports with warlords, insurgents, and drug traffickers.

While a few at the top are getting rich, the national poverty rate has actually increased in recent years. One statistic tells it all: Life expectancy in Afghanistan was in the bottom 19 percent of countries on the eve of the U.S. invasion. Today it’s still there.

The security forces are in no better shape despite – or perhaps because of — the U.S. lavishing $88 billion on military aid since the invasion.

“The Afghan military – and particularly the Afghan police – has been a hopeless nightmare and a disaster,” according to the special inspector general himself, John Sopko, in testimony to Congress in January.

Commanding officers pad the payrolls with phantom soldiers and pocket their salaries, while real troops are forced to buy their own meals from dishonest contractors who deliver short rations and spoiled food. Desertions are rife. An estimated 30 percent of police flee with their government-issued weapons and become bandits.

It’s no wonder the dispirited and poorly led Afghan security forces are crumbling before the Taliban, who have less weaponry but more motivation.

The Taliban already control about 70 percent of the country, according to independent experts. U.S. official reports show attacks by the Taliban increased 37 percent over last year and Afghan military casualties are trending “substantially higher” (although the actual number is classified).

The Afghan people are no fools. Since 2015, a majority of the public has felt the country was going in the wrong direction. 71 percent of Afghan men would support a peace agreement with a role for the Taliban in government, and even 45 percent of women agree, despite the Taliban’s unreconstructed opposition to women’s rights.

For those of us old enough to remember Vietnam, it’s the same movie, with the same ending.

In both cases, the U.S. supplied manpower and materiel in abundance but external aid can never substitute when a government fails to win the hearts and minds of its own people.

In both cases, the hollowness of the strategy was clear early on, but no one at policy level was willing to admit error, to take responsibility, and to chart a less gratifying but more realistic course.

Finally, our current president has had the courage to say, “Enough.”

The Republican opposition, of course, will try to pin blame on Pres. Joe Biden and the Democrats for “losing” Afghanistan.

But the truth is we lost Afghanistan the moment we let our reach exceed our grasp. And the biggest losers are the Afghan people, whose fragile gains toward a free society are collapsing as the unsustainable tide of dollars recedes.