Deserved is a value judgment I'm not going quite far enough to make. For perspective, I don't think that every white person who utters the N word deserves to lose their job, but I expect they will. In the case of Trump and the media, given a few suppositions, I think that this was the expected outcome. I actually do give Trump some credit that this may have been exactly the outcome he was pushing for, being a very media savvy individual.
Trump knew that the media reacted negatively, almost without fail, to certain types of activities. Trump knew that a certain significant portion of the voter base was sympathetic to some of those activities and the messages they represented. He ran an exceptionally inexpensive campaign by essentially providing the media with exactly what he knew they would react to and, when they unfailingly did, it galvanized the people who supported those things behind him.
The media is a large unwieldy beast which chases, unfailingly, what it thinks the public wants to hear - along certain lines, depending on the branch of the media. I don't believe it plots, per say, in the way you're suggesting, so much as just follows currents of popular expectation. Someone who knows what those currents are could, with the right platform, essentially goad the media into covering something excessively. Trump ran a perfect campaign to get massive coverage at virtually no cost - and in doing so, he courted the voter base that was supportive of those messages. This was not in spite of the media's attempts, it was because of them.
In the outcome, I do consider it quite possible that the media significantly favoured Trump through their actions, as they allowed him to run an effective, dirt cheap campaign, simply by doing what they would have done to anyone who poked the bear in the manner he did. In short? The media did precisely what they would have to anyone who would have acted like Trump did - and in doing so, they gave him the election.