THE RESIGNATION of David Petraeus as CIA director is a serious blow to the nation’s national security leadership, and it comes at an unfortunate moment. With the expected departure of Secretary of State Hillary Rodham Clinton and a possible reshuffling of senior officials at the National Security Council, President Obama could have benefited particularly from Mr. Petraeus’s knowledge and seasoning as he begins to grapple with second-term challenges in Iran, Afghanistan, Syria and elsewhere. Mr. Petraeus understands those issues as well as any American, and his record of service as a military commander is without equal in his generation.

Given those facts, some have questioned whether Mr. Obama should have accepted Mr. Petraeus’s resignation. The CIA director was found to have committed no crime. Adultery, which he confessed to, is not uncommon, including presumably among his agency’s staff. However, in our view the president made the right call. Mr. Petraeus’s failing was not merely an illicit relationship; he recklessly used a Gmail account to send explicit messages and, as a result, was swept up in an FBI investigation of alleged cyberstalking. Such behavior would not be acceptable in the private sector, or in the military, as Mr. Petraeus recognized.

The suddenness of Mr. Petraeus’s downfall came as a shock to many in Washington, prompting unreasonable questions, as well as reasonable ones. After first doubting whether Mr. Petraeus should have resigned, Senate Intelligence Committee Chairman Dianne Feinstein (D-Calif.) joined with her House counterpart, Rep. Mike Rogers (R-Mich.), in complaining that Congress had not been informed earlier about the FBI investigation. Others asked why it was not made public before last week’s election.

So far, the answers seem pretty straightforward: The FBI did not find a breach of security or evidence of criminality and so did not have a compelling reason to report the matter to Congress. Having concluded interviews with Mr. Petraeus and biographer Paula Broadwell days before the election, the agency briefed Mr. Petraeus’s immediate superior, Director of National Intelligence James Clapper, on Nov. 6 — an appropriate action, given the nature of the case. Republicans who suggest that FBI Director Robert Mueller or senior Justice Department officials should have reported what they knew before the election seem to be faulting them for not politicizing a criminal investigation.

That said, aspects of the probe should still be clarified. One concerns the role of an FBI agent who, according to an account by the New York Times, is an acquaintance of the woman who reported receiving threatening e-mails from Ms. Broadwell. After helping to initiate the investigation, the Times reported, the agent later contacted congressional Republicans, including House Majority Leader Eric Cantor (Va.); describing himself as a whistle-blower, he expressed concern — erroneously, it turned out — that a breach of national security had taken place. Whether those actions were appropriate may be a matter worthy of review. Mr. Mueller could also ease some legitimate congressional concerns by providing a more detailed account of the investigation, if necessary in a closed setting.

None of that will remedy the damage done by the loss of Mr. Petraeus’s service. It is a harm brought about by his own actions, for which he has taken responsibility. But it will hurt the country no less.