A woman with a resume as long as I-40 lost to the village idiot. No "Outside elements" should have mattered because Clinton should have been leading Trump (I mean REALLY leading) in the all the polls all the time 99 to 1. It was analogous to a race between Usain Bolt and a rock, with Bolt (HRC) starting two inches from the finish line in Central Park, NYC and the rock (the Donald) starting in Hawaii and I am being generous to the rock. Inside the bubble thinking, narrow vision, and hubris will lose you an election far more quickly and completely than Boris and Natasha and Fearless Leader ever will.
see this "should have" is the problem, because you are making two egregious presumptions:
1. that the overwhelmingly vast majority of the US population are not literally, physically, retarded.
2. that the positions and attitudes and behaviors of trump are seen as bad by people, or that anything he did could be counted as a negative or a reason not to vote for him.
americans are humans, and most (nearly all) humans are incomprehensibly stupid.
between the fucking idiots who looked at clinton and didn't see one of the best qualified presidential candidates we've had in this country in 40 or 50 years and the god damn morons who looked at trump and thought "this is totally a good idea to put this guy in charge" it was not only unsurprising but basically kind of inevitable that trump was going to win.
blaming the democratic party kind of proves the point to be honest, because their process nominated the experienced centrist (which is pretty much what the process is there to do) and the populace simply failed to recognize the quality of the candidate.
to say it's the fault of the democrats that hilary lost is tantamount to saying that the US population are jibbering dipshits who need to be spoon-fed a flashy song-and-dance show to be able to summon up the neuron firing required to understand who to vote for, and that US elections are nothing more than flamboyant charisma contests with zero acknowledgment of policy or competence.
(which is true, but establishment types of all stripes and the political body in general in this country like to take part in a vast fantasy that it isn't so)