Looks like Clinton had more voters in her favor and still loses. As happened when George W Bush won the presidency.
I'm not American, but if I lived in California, a landslide victory state in favour of Clinton, I would be disappointed that my vote doesn't really count. If I wanted Clinton to win and my State's already voting that way, I can't do anything to affect the balance of the closer tied states.
The USA is the country that talks about democracy the most, but the system is pretty far from a true democracy.
Sure, the votes were close, but I'm sure I could construct a scenario where a presidential candidate could get a large majority of votes, especially in the most populous states and still lose the election.