I don't see any "failure" in this election. Democracy is not, and will never be the decision of the majority against the minority. It's much more than that. In many countries, people don't believe that a simple "majority" can be enough to make democratic decisions. Their systems are based on "consensus democracy". So there can be different democractic systems with different rules.
In the United States, the system was designed to allow a better representation of the states. If an American state was isolated from the rest of the country, where would be the democracy?
Clinton obtained the majority with a short margin. But nobody could say that Clinton would still have won with different rules, because the rules influence the campaign, and Trump, with a different campaign, might have won the popular vote.