In the summer of 2008, putting Joe Biden on the ticket was “Barack Obama’s first decision.”

He was praised by Democrats and the media for his brilliant and serious decision. Choosing Biden, it was alleged, would provide foreign policy gravitas to the campaign and, eventually, the Obama Administration.

But Biden’s track record on foreign policy is terrible. Former Defense Secretary under Obama, Robert Gates, summed it up rather nicely earlier this year.

The vice president, when he was a senator — a very new senator — voted against the aid package for South Vietnam, and that was part of the deal when we pulled out of South Vietnam to try and help them survive. He said that when the Shah fell in Iran in 1979 that that was a step forward for progress toward human rights in Iran. He opposed virtually every element of President Reagan’s defense build-up. He voted against the B-1, the B-2, the MX and so on. He voted against the first Gulf War. So on a number of these major issues, I just frankly, over a long period of time, felt that he had been wrong.”

The latest blistering assessment of Biden was yesterday by Ali Khedery — the longest continuously serving American official in Iraq, acting as a special assistant to five U.S. ambassadors and as a senior adviser to three heads of U.S. Central Command.

Khedery wrote extensively yesterday in the Washington Post how the U.S. decision to leave Iraq under Obama resulted in Prime Minister Nouri al-Maliki squandering all of the political and military gains since the American surge of troops. He meticulously describes how Maliki consolidated power, defied the vanishing U.S. influence, and turned a multi-party government into a one-man show by 2009.

But Khedery’s eyebrow raising and most notable comments have hit Biden’s judgment square in the face.

On Sept. 1, 2010, Vice President Biden was in Baghdad for the change-of-command ceremony that would see the departure of Gen. Ray Odierno and the arrival of Gen. Lloyd Austin as commander of U.S. forces. That night, at a dinner at the ambassador’s residence that included Biden, his staff, the generals and senior embassy officials, I made a brief but impassioned argument against Maliki and for the need to respect the constitutional process. But the vice president said Maliki was the only option.

Indeed, the following month he would tell top U.S. officials, “I’ll bet you my vice presidency Maliki will extend the SOFA,” referring to the status-of-forces agreement that would allow U.S. troops to remain in Iraq past 2011.

Despite the reality on the ground for the better part of two years at what Maliki was doing, Biden’s foreign policy judgment was to stick with him. We all see the results of that now as Iraq is falling apart with lightning speed.

It is too bad that Biden didn’t cash in his bet. Perhaps Barack Obama would be better served by someone who at least got a few things right in his career over the last four decades.