Several surprises – with wide implications – are buried in the report that Justice Department Inspector General Michael Horowitz released Friday that found fired FBI Deputy Director Andrew McCabe lied to federal investigators.

The report provided new details about McCabe’s lies to cover up his self-serving leaking of information to a Wall Street Journal reporter about an FBI investigation of the Clinton Foundation – but also has implications for our constitutional democracy.

And the report shows that both McCabe and fired FBI Director James Comey deserved to be fired for presiding over a culture of unseemly leaks. The two plainly violated longstanding federal priorities, practices and policies. McCabe did so in the extreme, while Comey did so through a display of extraordinarily poor judgment, usurpation of power and abdication of leadership.

A thoughtful reading of the report shows that these FBI policies are sensible, sound and well-enforced.

One policy bars lying to federal officials – whether or not under oath – and quaintly describes such lies as “a lack of candor.”

The other policy restricts media contacts, saying “disclosures to the media must not address an ongoing investigation.”

McCabe failed to follow these policies, so he paid the price – just as any FBI employee should.

Through a laborious, systematic and thorough recitation of facts, the report by the inspector general makes a compelling case that Deputy Director McCabe had to go. One cannot wade through the report to the end and come to any other conclusion.

But what the report implies is as important as what it announces.

One revelation is that during the 2016 presidential election, upper reaches of the FBI – including the director, deputy director, agents and lawyers – were clearly confused and conflicted by repeated missteps by Democratic presidential candidate Hillary Clinton.

Conducting an investigation of any presidential candidate, at any point in any election cycle, was unprecedented, unnerving and unsettling to many – particularly those who seemed to favor her.

At least two investigations directly implicated Hillary Clinton in wrongdoing.

One investigation was prompted by a referral from the intelligence community, dealing with Clinton’s mishandling of classified information. That one widened to encompass a flotilla of potential legal violations tied to Clinton’s rogue email server, destruction of evidence and other bizarre actions.

The second dug into malfeasance, or worse, surrounding the Clinton Foundation and Clinton’s actions while secretary of state. Reading between the lines, FBI leadership was obviously distraught by the Democratic candidate’s proclivity for putting herself in legal jeopardy.

For the record, the inspector general’s report makes crystal clear that both of these pits of legal jeopardy were “investigations,” not mere “matters,” as Democratic Attorney General Loretta Lynch told the FBI to call them.

On balance, the McCabe leak seems par for the course – part of an FBI leadership culture that regularly used the media to influence internal policies in Washington and elsewhere. In short, while the deputy FBI director behaved incorrigibly, he was not alone.

Rather ironically, recall that the FBI stopped working with former British spy Christopher Steele because he leaked information to the media. He had been commissioned by Clinton’s campaign through a cutout to create the infamous anti-Trump “dossier.”

Shockingly, the inspector general’s report found that McCabe employed news leaks to counter other “anonymous” FBI and Justice Department news leaks. There is no defense for that kind of manipulation of the public.

The impression left by Inspector General Horowitz’s report is sobering. It describes an agency culture, at the top, entirely comfortable with anonymous leaks to the media for bending internal policies and possibly affecting politics.

This seems to fly in the face of the two FBI policies citied above.

Add to this the major news leak by James Comey, who slipped what he thought was damning information to a Columbia University professor on a “Russia collusion” story.

Comey succeeded in using the leak to prompt the hiring of Robert Mueller as a special counsel to investigate President Trump, the man who fired Comey.

Hell hath no fury like an FBI director scorned.

What is the Justice Department inspector general really saying? The report is about more than McCabe. It says the FBI’s leadership culture is in deep need of review, a victim of its own arrogance, indifference and political capture.

Inspector General Horowitz is also saying, in this tidy, detailed, non-political, highly credible report, that Comey and McCabe were both distracted, disinterested, and patently poor leaders.

Intended or not, the ultimate implication in the inspector general’s report is this: President Trump was fully entitled to remove both Comey and McCabe. The FBI cleaned out McCabe. The president sent Comey packing. The inspector general’s report seems to justify both actions.

With full credit to Winston Churchill, another straight shooter, if this is not the end of the story, or not even the beginning of the end, perhaps it is the end of the beginning. Let us fervently hope so.

Robert Charles is a former assistant secretary of state for President George W. Bush, former naval intelligence officer and litigator. He served in the Reagan and Bush 41 White Houses.