It is not hard to see why Americans shun the topic. They have experienced the war as a long series of bitter failures and of noble missions that turned out not to be. They have disengaged out of moral self-preservation as much as exhaustion.

For decades, leaders portrayed Afghanistan as a beautiful but lawless land to which the United States would bring order and American values, somewhat similar to the old Western frontier. Their adventure began in 1979, when the Soviet Union invaded and the United States armed Afghan rebels. President Ronald Reagan called this “a compelling moral responsibility of all free people” and a battle for “the human spirit.” Rebel leaders were romanticized and taken on tours of American churches, according to “The Looming Tower,” a book by the journalist Lawrence Wright.

Those rebels turned against one another in a long civil war that gave rise to the Taliban. Americans were then sold on invading Afghanistan in 2001, to bring the Sept. 11 attackers and their accomplices to justice. The Taliban government quickly fell, raising a question that became obvious only after it was raised: Now what? What should take the Taliban’s place, and how to make it stick despite the group’s continued support?

Iraq quickly distracted attention and resources from the Afghanistan question until 2008, when Barack Obama was elected president while promising to end the former and win the latter. Afghanistan became the good war. Americans were sold on promoting democracy and, later, on saving the women — an ambition captured by a 2010 Time magazine cover showing an Afghan woman who had been mutilated by Taliban officers.

But practice did not match the ideals. Seeking allies where it could, the United States often directly empowered warlords whose corruption, drug trafficking and violence seemed little better than the Taliban’s. Drones proliferated overhead and airstrikes killed civilians on the ground, provoking anguished debate at home. Pakistan, at once Washington’s closest and least reliable ally in the war, played both sides.

Americans were left feeling they had compromised their morality, and to little gain. As the 9/11 attacks receded more than a decade into the past, it became harder to argue for the war’s necessity. American gains against Al Qaeda only drew more attention to the loftier goals that never seemed to advance.