Hillary lost for two core reasons:

a) Most of her support was collected heavily into two states, NY and California, which meant that a lot of that popular vote was wasted winning EC races in those states that were already won.  It's like ridings in rural Alberta going 88% to the PCs back in the day. 13% would win the riding, and the other 75% is essentially wasted.

b) She lost too many votes with ethnic voters that Obama won. When Trump goes UP with ethnic voters over Mitt Romney, it's a notable shift.

But, she also salted her own wound and ran an essentially sexist campaign. What man wouldn't think twice about voting for her when she proposes a more 'sensitive' criminal justice system ... just for women? When her supporters are lambasting 'Bernie Bros' for being sexists during the primaries? When she has a history of making mind-numbing statements like women and children always being the primary victims of war? Don't sell me sexism as equality.