Conventional wisdom stated that Obama needed someone with lots of foreign policy expertise. Conventional wisdom also suggested that the chairman of the foreign relations committee would be the person with such expertise.
Unfortunately, experience does not always lead to expertise. Don't get me wrong; Biden did some good work in the Balkans. And he was right to label Milosevic as a "war criminal." (Things should be called what they are.)
On the other hand, Biden has a long history of popping off in ways and times that are not appropriate. His face-to-face indictment of Milosevic, while true, was not the most useful way to improve the situation in the Balkans. A frequent criticism of Biden is that his mouth shifts into overdrive while his brain is still in neutral.
But even more important than Biden's infamous mouth is his tendency towards conventional thinking. A big part of his self-assuredness comes from his inability to consider solutions that are not part of the mainstream conversation. More than any other aspect of the Presidency, foreign policy requires an imaginative, original approach. Conventional thinking allows other countries to steal a march on the US, since our reactions will be predictable and relatively unimaginative.
In the runup to the Iraq War, Biden demonstrated this inability to think outside the box by throwing his support behind the administration. The Bush administration set up a false dicotomy (either "cave in to Saddam" or "invade and occupy"). Biden was in a position to lead more substantive criticism of the Bush approach. QuickOverview has a pretty good summary of Biden's position on Iraq:
Following the September 11, 2001 attacks, Biden was supportive of the Bush administration efforts, calling for additional ground troops in Afghanistan and agreeing with the administration's assertion that Saddam Hussein needed to be eliminated. The Bush administration rejected an effort Biden undertook with Senator Richard Lugar to pass a resolution authorizing military action only after the exhaustion of diplomatic efforts. In October 2002, Biden supported the final resolution of support for war in Iraq. He continues to support the Bush Administration's war effort and appropriations to pay for it, but has argued repeatedly that more soldiers are needed, the war should be internationalized, and the Bush administration should "level with the American people" about the cost and length of the conflict.
In addition to being in conflict with Obama's longstanding opposition to the war, it is hard to see any original thinking in this position.
Obama has repeatedly stated that McCain has demonstrated a lack of judgment, based on his support for the invasion and occupation of Iraq. How can he defend his running mate's support for the same conflict? If McCain's support is such a fatal flaw, what are we to make of Obama's willingness to put this fatal flaw within a heartbeat of the presidency?
Moreover, McCain's early and courageous support for the surge demonstrated a willingness to think outside the box. He took on a sitting Defense Secretary, and he worked tirelessly to pull together a behind-the-scenes coalition to force Bush to change his approach towards the war and shift towards the approach supported by General Petraeus. More important than the "surge" has been the change in approach in Iraq, as exemplified by Petraeus' battle to capture the hearts and minds of the Iraqi public.