Barack Obama came into office intending to correct his predecessor's biggest mistakes by ending the wars in Iraq and Afghanistan. He didn't, because he made his own grievous mistake: choosing to prolong failure rather than admit it.

The error is not original with Obama. George W. Bush did the same thing in those wars, persisting in them mainly because he didn't know what else to do. So did Lyndon B. Johnson and Richard Nixon in Vietnam.

LBJ once confided his dilemma: "I can't get out. I can't finish it with what I have got. So what the hell can I do?" Nixon ran on a promise to end the war in Vietnam, but some 20,000 Americans died there under him—without changing the dismal outcome.

Even Obama's fiercest critics would not have imagined he would complete two terms in the White House without extricating the United States from either war. The peace candidate has been a war president.

After withdrawing all forces from Iraq in 2011 and setting forth a plan to end the war in Afghanistan by the end of 2014, Obama let himself be sucked back in. We now have some 5,500 troops in Iraq and nearly 10,000 in Afghanistan—far fewer than under Bush but far more than zero.

The reason for staying was simple: to avert defeat, if only for the time being. After the U.S. vacated Iraq, the Islamic State emerged as a new threat to the Baghdad government and others in the region. As we headed for the exit in Afghanistan, the Taliban came roaring back.

Hawks took these developments as vindication, saying: "See? We should have continued the wars at full strength." But the outcomes only confirmed the futility of our efforts. The goal of invading Afghanistan and Iraq was not to put them under permanent U.S. occupation. It was to topple the ruling governments and enable their people to flourish on their own.

In that, we obviously came up pitifully short in both countries. They entered years of violent turmoil from which neither shows any sign of emerging. Yet Obama operates as though with more time and more American help, they can attain peace and fulfill our hopes.

What possible reason does he have to believe that? Bush insisted that the 2007 surge in Iraq would not only produce military success but bring about "a functioning democracy that polices its territory, upholds the rule of law, respects fundamental human liberties and answers to its people." In the ensuing years, Iraq failed to realize his shimmering vision. No surprise there. The question is why anyone ever dreamed it could.

Ditto for Afghanistan, where we have been mired for nearly 15 years. The point of Obama's surge, announced in 2009, was simple: to "create the conditions for the United States to transfer responsibility to the Afghans." Yet here we are 6 1/2 years later, still waiting for them to take ownership of their future.

The chief reason Obama made these new military commitments was simple: He treated defeat as intolerable. But the American efforts in Iraq and Afghanistan are not likely to prevent defeat—only to postpone it.

Even if we could eliminate the militants, the conditions that spawned them would not abate. We crushed the insurgency once in Iraq, but the Baghdad regime didn't take advantage of the success to overcome the country's lethal divisions. The Kabul government has managed to preserve its hard-earned reputation for corruption and incompetence year after year.

One thing the U.S. government has demonstrated in this century is that we know nothing about nation building. We can't solve the problems afflicting these countries, and we have aligned ourselves with governments that also lack that capability. Our presence does more to create radicalism than to kill it.

Nor can we outlast homegrown enemies. It's their country, and their attachment will always exceed ours. They don't have to beat us on the battlefield. All they have to do is survive until we run out of patience, which will happen sooner or later.

It may be much later, because presidents don't like to lose wars, even wars that are unwinnable. They would rather prolong them indefinitely, even though it means wasting American lives for nothing.

Early in his presidency, Obama told his advisers, "I don't want to be going to Walter Reed for another eight years." Yet he has. Thanks to him, the next president will also be making those visits.

© Copyright 2016 by Creators Syndicate Inc.