The worst, sleaziest parts of the horrible, sleazy 2016 presidential campaign came roaring back on Thursday, like a nightmare.

First, there was the almost 600-page inspector general’s report from the justice department that sharply rebuked former FBI director James Comey for his gross mishandling of the Clinton email investigation. I have written previously that Comey’s bad actions in the email case probably cost Hillary Clinton the election and the IG’s report certainly confirms his many flawed actions and decisions.

There was also the lawsuit against the Trump Foundation filed by the New York attorney general after a two-year investigation. The lawsuit is another bad acid flashback, documenting how the Trump family used its charitable foundation as a personal piggy bank to bestow favors on friends and to make outrageous, personal purchases, such as a giant portrait of the president that had no charitable connection whatsoever.

Reading both documents, the IG report and the lawsuit, fills any sane person with the deepest regret that Donald Trump is president. This is a tragedy that could have been prevented, according to my reading of the justice department’s report. And anyone needing more evidence that Trump lacks the moral or ethical moorings to be president need only peruse the New York lawsuit eviscerating the Trump Foundation.

Despite his sanctimony, his best-selling book and his claims to martyrdom after Trump fired him, James Comey is a singular villain. Though the IG report states that he had no political motive in doing so, he upended the 2016 election and all but destroyed Clinton’s candidacy.

Trump and family sued by New York attorney general over alleged charity violations Read more

First came his terrible decision to denounce Clinton’s carelessness despite his bureau’s conclusion that she did not deserve to be indicted in the email case. That was a departure from prosecutorial practice, where legal norms call for public silence when there are no charges. On this serious misstep the report states, “It was extraordinary and insubordinate for Comey to do so,” and the inspector general added, “and we found none of his reasons to a persuasive basis for deviating from well-established department policies in a way intentionally designed to avoid supervision by department leadership.”

Comey kept his ill-considered decision to be a press hog hidden and Loretta Lynch, then the attorney general, could not stop him because of her own errors. The report calls her out for her airport meeting with Bill Clinton just as her department was deciding the email case, creating a conflict that effectively took her out of the decision-making process. She deserves the considerable blame directed her way in the report.

Then comes the even worse cascade of events in October, when Comey made the even worse decision to reopen the email case after the FBI seized Anthony Weiner’s laptop in a separate investigation. His computer contained some of his wife’s copies of Clinton’s emails. Although these emails turned out to be duplicates of messages already inspected by the FBI, Comey precipitously decided to reopen the investigation. His letter to congressional Republicans reopening the email investigation dominated the headlines during the last days of the election. Voters who were late deciders, and there were enough of them to turn the election, fled from Clinton during these final days of the campaign, contributing to her loss.

The inescapable conclusion of the report is that the FBI under Comey was a ship of fools. There was no need to reopen the investigation, especially so late in the election, as the FBI seized the Weiner laptop in September.

Facebook Twitter Pinterest ‘The FBI under Comey was a ship of fools.’ Photograph: J. Scott Applewhite/AP

The listing ship included agents Peter Strzok and Lisa Page, FBI officials who were involved in both the Clinton and Russia investigations, leading Trump’s supporters to suspect a conspiracy against him. Many of their text messages have been previously released, but the inspector general cites a previously undisclosed message in which Strzok says the FBI “will stop” Trump. This certainly adds to an appearance of being anti-Trump but the IG concluded: “Our review did not find documentary or testimonial evidence directly connecting the political views these employees expressed in their text messages and instant messages to the specific investigative decisions we reviewed,” the report said. Page is gone but Strzok is still employed at the justice department.

Unfortunately, this well-documented and well-reasoned report will surely provide ammunition for Trump’s outrageous attacks on the legitimacy of federal law enforcement and his efforts to undermine the justice department and the FBI. The internal watchdog’s sharp criticisms of Comey will also be used to bolster Trump’s decision to fire him, even though that decision involved Comey’s correct insistence on pursuing the Russia investigation into former national security adviser Michael Flynn and other Trump allies.

Recent public opinion polls show that support for Robert Mueller, the special counsel in the Russia investigation, is foundering. I hope the IG report, which finds that the FBI’s decision to prioritize the Russia investigation before the election was not “free of bias”, does not provide new fodder for Trump’s empty claim that the Mueller inquiry if a partisan witch-hunt.

As for the lawsuit against the Trump Foundation, we already knew that the Trumps used their charity as a private piggy bank and that, thanks to the great reporting of the Washington Post’s David Fahrenthold, almost none of the Foundation’s money actually came from the Trumps. Still, the president was already tweeting on Monday that the lawsuit is partisan and tainted by the sexual misconduct of the disgraced former New York attorney general.

If only we’d had a more prudent FBI director in 2016. If only more attention had been paid to the Trump Foundation than Clinton’s meaningless emails. If only …

• Jill Abramson is a political columnist for the Guardian