The fall of the Afghan city of Kunduz, a major regional center, to the Taliban may turn out to be temporary, but it was nevertheless a stunning defeat  for the Afghan army. “Fall” is the operative word. It took only 500 Taliban fighters to capture the city from an American-trained force of more than 7,000 Afghan soldiers who had put up little defense before retreating.

The episode makes all the more urgent the need to ask what purpose is served by continued U.S. military involvement in Afghanistan. The loss of Kunduz did not come as a surprise. Corruption and incompetence have long plagued both the Afghan army and the government. Soldiers complain of lack of leadership and say their commanders sell their ammunition and other supplies and pocket the money. In some areas the desertion rate is 50 percent.

The supposed unity government of President Abdul Rashid Ghani and his chief executive Abdullah Abdullah is torn by bitter feuding, according to Ershad Ahmadi, a former Afghan government official, and has failed to focus on issues of chief concern to the Afghan people, such as the economy, security, and efficiency.

The U.S. invasion of Afghanistan in 2001 was widely perceived in the U.S. as “a good war” in a  righteous cause — capturing Osama Bin Laden and avenging the murder of 3,000 innocent civilians. Some Middle East analysts objected, however, saying that a police action aimed at Al Qaeda would be a far more effective way to combat terrorism than a full-scale invasion of a  Muslim country. They warned that Afghanistan had successfully repelled every foreign invader since Alexander the Great.

Today after 14 years of fighting and the loss of some 2,000 American soldiers and uncounted numbers of Afghan civilians and soldiers, their warnings have proven valid. The number of terrorists has steadily increased, with the Islamic State and Boko Haram today more of a threat than Al Qaeda. The Taliban have recaptured much of the territory they retreated from in 2001; the growing and sale of opium poppies that the Taliban once banned has resumed; and despite billions in foreign aid, the country remains one of the poorest and most corrupt in the world.

Many of the warlords who once ruled in the north have been restored to power by Afghan President Ashraf Ghani. General Abdul Rashid Dostum, who is notorious for having killed thousands of Taliban prisoners after the U.S. invasion by suffocating them in shipping containers, is now the country’s vice president. Today Dostum lives in a villa that a U.S. Embassy official said resembled “a three-star hotel in the Persian Gulf” and rules over a fiefdom.

In an interview with a New York Times reporter last August, Dostum boasted that  right after the invasion, the U.S. Special Forces “were giving me $50,000 every 15 or 20 days.” The total came to $400,000, he said, then laughed. “But I spend that much in one day.”

The source of Dostum’s wealth is no mystery. The warlords control private militias that make a practice of extorting money from villagers, seizing their crops, and looting their houses.

Torture and murder by Afghan security forces, as well as theft and corruption, have  long been tolerated by the U.S. and its NATO allies. The New York Times recently revealed that the Pentagon’s tolerance has also extended to rampant child rape by Afghan military officers. The practice was banned under the Taliban, but U.S. military officials tried to write off the practice of raping small boys as a cultural difference between Afghans and the West.

The fact that American soldiers who were sickened by the treatment of children by Afghan officers were ordered to ignore what was happening makes the U.S. complicit in acts of indefensible brutality. After 14 years of a damaging war, the U.S. has an obligation to provide economic and other  aid to the Afghan people.

But whatever is to be gained from our continued military presence in Afghanistan is surely not worth the price we are paying to achieve it.