President Kennedy displays the combat flag of the Cuban landing brigade that took part in the Bay of Pigs invasion, Dec. 29, 1962.

Photo: Corbis via Getty Images

White House infighting can be a bad thing. But when advisers refuse to disagree with the president, an administration can be at risk of groupthink. The history of the U.S. presidency has shown that this can lead to disaster. We now see how fear of disagreement with President Biden doomed the decision-making process for the U.S. withdrawal from Afghanistan.

The problem of groupthink was evident during the Vietnam War, when Lyndon B. Johnson was mostly intolerant of differing opinions on Vietnam. One adviser, George Ball, was designated as the in-house skeptic, but this role made Ball an outcast among his colleagues. As Johnson aide W. Marvin Watson wrote of Ball, “The arguments he expressed—always calmly but forcibly stated—were, to say the least, annoying to the President’s other advisors.”

And if you weren’t Ball, standing apart from Johnson on Vietnam was dangerous. Johnson maintained a narrow circle of advisers on Vietnam, dismissed internal dissenters, and berated those, like Defense Secretary Robert McNamara, who became more skeptical about the war over time.

Johnson called one McNamara proposal for a bombing halt in Vietnam “a load of s—.” He suspected McNamara was more loyal to “the Kennedys” than to him, and eventually Johnson dismissed him. Staffers who disagreed with Johnson’s Vietnam policy had to meet secretly in what they called the “nongroup” so he wouldn’t know about their conversations. Had Johnson sharpened his thinking with dissenting opinions, he might have reduced the 35,000 Americans who died in Vietnam on his watch, prevented the souring of U.S. public opinion on Vietnam, and stayed in office past 1969.

There is a historical example of an administration that fell into groupthink, saw the disastrous consequences, and righted the ship. The 1961 Bay of Pigs debacle occurred in part because no one among John F. Kennedy’s advisers was willing to play devil’s advocate. As the historian and Kennedy aide Arthur Schlesinger wrote of the decision to send poorly trained Cuban exiles to overthrow Fidel Castro, “our meetings were taking place in a curious atmosphere of assumed consensus, [and] not one spoke against it.”

Following the Bay of Pigs, Kennedy was determined to change. He created The Executive Committee of the National Security Council—known as ExComm—a group that could debate national-security issues openly. The ExComm deliberately included people outside the National Security Council to get external opinions. It held informal meetings without an agenda to allow for unrestricted conversations. It met both with and without the president to ensure that his opinions didn’t stifle debate. The Kennedy team successfully used the ExComm for deliberations during the 1962 Cuban Missile Crisis, which was resolved without nuclear confrontation.

In the aftermath of the Afghanistan disaster, the Biden administration should consider this history. Part of the problem with the Afghanistan decision-making process was that the president didn’t appear to be hearing dissent from his political aides. Some military and intelligence advisers seem to have pushed back against withdrawal, but his top political aides, Secretary of State Antony Blinken and national security adviser Jake Sullivan, were reluctant to do so. The pair raised the possibility of Taliban attacks on U.S. forces and diplomats, as well as on Afghans who worked with the U.S., but neither disagreed with Mr. Biden, knowing that he had made up his mind. This is reminiscent of Johnson and the Vietnam War. It also suggests that a Kennedy ExComm approach, in which some meetings take place without the president, might allow aides to question administration policies more freely.

The National Security Council process, which is supposed to develop interagency consensus on foreign policy and defense issues, can raise different points of view, even uncomfortable ones, if the president allows it. But Mr. Biden has to be willing to allow robust internal debates, and he must signal that he and his team won’t ostracize those who put forth contrarian ideas.

Another problem is that Biden seems particularly sensitive to stories about internal disagreements. According to the book “Lucky: How Joe Biden Barely Won the Presidency” by Jonathan Allen and Amie Parnes, Mr. Biden dislikes “process stories,” by which he means news articles about “palace intrigue.” If aides know the president doesn’t want to read about infighting, they will strive to make him happy by minimizing behaviors that signal disagreement.

To solve this problem, Mr. Biden should look closely at the quality of debate and discussion in the White House. He should seek out diversity of thought and reward those who have the courage to challenge orthodox beliefs.

It isn’t too late for the Biden administration to rethink its internal process to make sure it can handle internal disagreements productively. An early administration failure can provide an opportunity to recalibrate and potentially avoid worse failures in the future.

Mr. Troy is a senior fellow at the Bipartisan Policy Center and a former senior White House aide. His latest book is “Fight House: Rivalries in the White House From Truman to Trump.”

Journal Editorial Report: Paul Gigot interviews General Jack Keane. Image: Shakib Rahmani/AFP via Getty Images The Wall Street Journal Interactive Edition