Comey began to dig himself a hole with his investigation of Hillary Clinton's use of a private email server for classified information. He closed the investigation and then reopened it right in the final stages of the presidential campaign, and then promptly closed it again. Those decisions stunk of political interference, or at least influence.
Then it was revealed that the FBI had been investigating the Trump team's connections to the Russians during the election campaign. I have written before about how I think the accusation of a Trump-Putin conspiracy is baseless, if for no other reason than Putin had nothing to gain and everything to lose from a Trump election. In any event, Clinton also had contact with the Russians during the campaign, and there is nothing wrong with a presidential candidate establishing links with important foreign leaders prior to taking office. Even if it is proven that the Russians acted to help Trump win, that is not illegal or even unusual - after all, President Obama tried to influence the outcome of the Brexit vote and did his best in the last Israeli election to stop Netanyahu being re-elected. Besides, nothing the Trump team might have done with the Russians could compare with the dealings Hillary Clinton and the Clinton Foundation had with Russian and Kazakhstani interests while she as Secretary of State was approving their takeover of American uranium mines.
Leaving aside the merits of the cases, I think the fact that the FBI was investigating both of the major candidates during the presidential election campaign - and in the case of the Clinton investigation, discussing it publicly - is a very unhealthy state of affairs for U.S. democracy. They say J. Edgar Hoover had an enormous influence on politics during his 37 years as FBI director but at least he had the good sense to play his cards close to his chest. Comey came to believe he was the most important player on the stage rather than someone who should stay in the background. Clearly, the job had got a bit much for him, or he had become a bit much for the job.
Trump has done the right thing sacking Comey and I am sure Hillary Clinton would have done the same thing had she made it to the Oval Office. The President and the American public need to have confidence in their FBI director and clearly that was no longer the case.