President Obama’s ambivalence about his own Afghanistan strategy, described in a memoir by former defense secretary Bob Gates, should come as no surprise. After all, when Obama went to West Point in 2009 to announce a surge of troops, he also announced a date for their withdrawal, regardless of whether they had accomplished their mission.

What Gates saw as a contradiction was, in fact, the beginning of a foreign policy transformation that was still taking shape when Gates retired in 2011.

The president has evolved from someone who was perceived as — and maybe expected himself to be — an inspiring world leader into one who may have the least idealistic policy of any president in decades.

When he spoke to a vast crowd in Berlin as a candidate in 2008, Obama was expansive.

“America cannot turn inward,” he declared. “This is the moment we must help answer the call for a new dawn in the Middle East. . . . We must support the Lebanese who have marched and bled for democracy. . . . [W]e must come together to save this planet. . . . With an eye toward the future, with resolve in our hearts, let us remember this history, and answer our destiny, and remake the world once again.”

Five years later, Obama was explicitly declaring that promoting democracy and human rights was not an American “core interest.” He was dismissing the idea of U.S. involvement in Syria, where 100,000 people had died and 6 million had been forced from their homes, by labeling it “somebody else’s civil war.”

Obama had not become an isolationist. He continued to pursue ambitious trade deals with Asia and Europe and a nuclear agreement with Iran. He waged the drone war against terrorists.

But he had come a long way from standing with those who march and bleed for democracy, preferring what he called “nation-building at home.”

In retrospect, the Afghanistan troop surge represented the high-water mark of the Berlin worldview. His second thoughts can be seen in how Obama has spoken of the Afghan mission ever since: almost always in terms of safeguarding the United States from al-Qaeda, rarely in terms of promoting democracy or protecting Afghan women.

He was content to pull all troops from Iraq rather than negotiate a train-and-support presence. After helping to hasten Moammar Gaddafi’s downfall in Libya, at the urging of allies, he washed his hands of the country, disdaining any support missions until near-anarchy forced NATO’s hand two years later. He spurned his top advisers when they urged aid for the moderate opposition in Syria. He is cutting funding for democracy promotion throughout the Middle East.

The economic collapse that Obama inherited and Americans’ fatigue with foreign entanglements undoubtedly help explain the constriction of his vision. The foreign policy disappointments of his first term may as well.

Obama came to office with three big ideas, none of which entirely panned out.

The first was that his predecessor had disdained diplomacy and that, by engaging rationally and persuasively with adversaries, Obama could make more progress.

But his bet on Russian President Dmitry Medvedev soured when it turned out that Vladimir Putin had never really ceded power. China’s leader cold-shouldered Obama at a climate summit in Copenhagen. Israeli and Palestinian leaders proved immune to his importunings for a peace settlement. Egypt’s first democratically elected president, Mohamed Morsi, ignored his advice to be more inclusive. Even Obama’s overseas trip to win the Olympic Games for Chicago came up short.

These disappointments limited the scope for his second big idea, which was to promote nonproliferation and a world free of nuclear weapons, though the Iran talks remain a possible bright spot.

Obama’s third ambition was to “pivot” from an over-emphasis on countries of little strategic value in Central Asia and the Middle East to the more vibrant economies of Asia and the Pacific. A rebalancing was announced, but upheaval in the Arab world, the continuing (perhaps growing) threat from al-Qaeda and cuts in the defense budget combined to limit the scope of any shift.

Given that Obama entered office with little foreign policy experience, it’s not surprising that events would shape his perspective. You’d worry if he did not evolve and adapt.

But his shift from idealism to what he sees as pragmatism may prove to be anything but realistic. With violence and misery radiating outward from Syria to Iraq, Lebanon and beyond, the United States is likely to be forced to reengage, and on less favorable terms than it might have found two or three years ago. Presidential candidates in 2016 may find themselves paraphrasing the eloquent Barack Obama of 2008.

“History has led us to a new crossroad, with new promise and new peril,” the candidate said. “A change of leadership in Washington will not lift this burden. In this new century, Americans and Europeans alike will be required to do more — not less.”

Read more from Fred Hiatt’s archive, follow him on Twitter or subscribe to his updates on Facebook.