I think just looking at how the electoral map has gone, the stories the media covered and raised up as major issues with Trump fell on completely deaf ears. Why you ask? Because he spoke to the working/middle class and made all the right promises to help those people in their lives. People are far more worried about their paycheck and their mortgage then they are about racism and sexism. It's disgusting but it's true. If I have to choose between having an easier time paying for my house or not having a racist leader, a lot of people are gonna swallow their pride if it means making things easier on their family.
Add in Clinton was an extremely weak candidate at this juncture in time, it was the perfect storm for something like this to happen. It looks like everything has flipped, at one point the Republicans were looked at like the rich upper class overlords, thus how the Democrats took power. Now people are looking at Democrats that way, while the Trump campaign hit the ground running and aimed at the issues that the working person cares about the most. Meanwhile you have Hilary spouting on about taking care of the climate. In a state like mine where there is a ton of coal plants and is a primary money maker here, it's equivalent to her saying she's going to kill your jobs. That's just one example but that type of attitude spreads throughout.
A lot of the problems in Washington DC started with the Republicans, but the anger over those problems crested when the Democrats were in power, and it's extended to this election. Hillary basically walked in and became the embodiment for a lot of people for the perceived corruption and the feeling of the working class being cast aside.
This election was far more about economic issues to people than it was to social issues. They want food, shelter, and stability. Trump sat down and looked them in the face and told them he can do that. Hillary only promised a continuation of where we are presently. And I think that has a huge part in what's gone down tonight.