The new tell-all memoir of former Secretary of Defense Robert Gates, the Obama carryover from the George W. Bush administration, breaks with the traditional code of cabinet members. The code dictates that they keep their reservations on presidential decisions to themselves at the time and then take them to the grave.

Instead, Mr. Gates writes in "Duty: Memoirs of a Secretary at War" that for much of his more than two years in the Obama cabinet, he silently seethed at what he saw as the president's focus on disowning Bush's war in Afghanistan and, as Gates puts it, his being "all about getting out."

A longtime Republican in a Democratic administration, Mr. Gates writes that "I believe Obama was right in each of his decisions" on the war in Afghanistan. But he singles out Vice President Joe Biden and former National Security Adviser Tom Donilon, a one time political adviser to Mr. Biden, for having undue influence on President Obama's military decisions.

"All too early in the administration,"Mr. Gates writes, "suspicion and distrust of senior military officers by senior White House officials -- including the president and vice president -- became a big problem for me as I tried to manage the relationship between the commander in chief and his military leaders."

Mr. Gates accuses Biden of "poisoning the well" against the advice of military leaders who in White House meetings in late 2009 argued for a "surge" of 30,000 additional U.S. troops into Afghanistan. Gen. Stanley McChrystal, the commander there at the time, had requested them to shore up the effort against the Taliban insurgency.

Vice President Biden played the house skeptic in the internal debate. He argued in turn that Mr. Obama should focus on the original justification for fighting in Afghanistan -- removing the sponsors of the 9/11 al-Qaida terrorist attacks. Mr. Obama finally agreed to the troop surge, but with the caveat that the decision be reviewed a year later with an eye toward withdrawal of the 30,000 starting in July of 2011.

Mr. Biden was generally cast as the loser in that debate. However, it was his insistence that the American commitment in the war in Afghanistan not be open-ended that was critical in the compromise struck by Obama and agreed to by the Pentagon leaders, including Mr. Gates, however reluctantly at the time.

For the biography of Mr. Biden I wrote subsequently, President Obama was asked what he thought of the conclusion that his vice president had been the loser in the debate. He replied:

"I don't think anyone who was party to the very, very exhaustive discussions we had would say that. Joe was enormously helpful in guiding those discussions. The decision that ultimately emerged was a synthesis of some of the advice he gave me, along with the advice that Secretary Gates and Generals (David) Petraeus and McChrystal offered. I think we arrived at exactly the right answer, and we would not have gotten there as quickly, or at all, without each of their contributions. The vice president played a vital role in that process."

Mr. Obama's decision in 2008 to ask the longtime Republican Mr. Gates to remain as secretary of defense after his tour as Mr. Bush's Pentagon boss was generally seen as an effort to demonstrate some bipartisanship. Mr. Obama had pointedly declared his opposition to Mr. Bush's invasion of Iraq, while supporting his military response to the 9/11 terrorist attacks by perpetrators harbored by the Taliban regime in Afghanistan. Mr. Gates resigned in 2011, replaced by Democrat Leon Panetta. But in 2013 Mr. Obama named another Republican, former Nebraska Sen. Chuck Hagel, a decorated Vietnam War enlisted man, to replace Panetta.

At the time, Mr. Hagel was a member of Mr. Obama's Intelligence Advisory Board and had traveled to Afghanistan with Mr. Biden as fellow members of the Senate Foreign Relations Committee. In another interview for the Joe Biden biography, Mr. Hagel credited Mr. Biden with constructively testing the assumptions of the surge during those long 2009 deliberations.

As defense secretary, Mr. Hagel has been a strong supporter of the Obama strategy for winding down the Afghan war while being, as Mr. Gates was, a stalwart defender of the American military. But the echoes of Mr. Gates' now-revealed dissatisfaction with his tenure in the job are another distraction with which Mr. Obama must contend. 

Jules Witcover is a syndicated columnist and former long-time writer for The Baltimore Sun. His latest book is "Joe Biden: A Life of Trial and Redemption" (William Morrow). His email is juleswitcover@comcast.net.