That’s not an accurate picture of the media’s coverage. What they did was ratings and profit driven.
In the primaries, they gave Trump massive free publicity and gave him a pass on most of his policy stances. Meanwhile, they attacked Clinton non-stop, in the hopes of making the Democratic primary good TV.
A recent Harvard study conducted an analysis of eight different cable networks and newspapers and found that media companies devoted an unprecedented amount of coverage to Donald Trump from the start of his campaign, effectively shutting out over a dozen of his competitors. The Shorenstein analysis also learned that the Republican candidates got roughly twice as much media coverage as the Democratic candidates.
In addition, although Clinton got far more coverage than Sanders, she got breathtakingly negative coverage, even compared to Trump:
When the general election came, they did everything they could to make sure it would be a close race and keep people watching. They may not have wanted Trump to win, but they stay focused on the non-issue of Hillary’s emails and conveniently stopped talking about all of Trump’s outrageous statements, the lawsuits against Trump University, and all the infractions committed by his own charitable foundation for the last two weeks leading up to the election.