Supposedly the national security issues involving Russian espionage caused FBI to believe that if the investigation was publicized it would compromise their sources and methods in uncovering what was happening.
But the mainstream media outlets who failed to inform the public had not only been informed of the dossier claims during the campaign but also had all the evidence of years of reporting on Trump's long history of scandalous unethical business practices. Media spent so much more time disparaging Clinton's emails than covering anything seriously negative about Trump. I always remember that after Bill Clinton won re-election against Bob Dole, the Washington Post publicly admitted that they withheld reporting Bob Dole's extramarital and workplace affairs because they thought Bill Clinton was going to win the election. So, they didn't want to be accused of negative reporting against Dole but they were more than willing to report allegations of Clinton's affairs.