Amazingly, she lost to a guy who 60% of voters stated was wholly unqualified to be President of the USA (42% voted for her, 18% still voted for him!) because..........
People simply do not like Hillary Clinton. I mean, there can be no other explanation. She failed to match Obama in virtually any category of Obama voter. She got 5,000,000 votes less than Obama (even though Trump will get fewer votes than did Romney).
The short answer is that you can do all of the looking and analyzing you want, but if blacks and women and young people do not go to the polls, Democrats lose. And these people never felt that they'd like to vote for Clinton as much as they had wanted to vote for Obama.
The most surprising exit poll was that Trump (who called Mexicans murderers and rapists) won FAR more Hispanic votes than did Romney! Clinton was unable to even convince 70% of Hispanics that they probably ought to vote against the most racist candidate to run for President since at least George Wallace, and maybe since Strom Thurmond. Instead of a 70-17 Obama beatdown, Clinton only managed 63-29. That is a 19 point decline.
Sometimes you just have a bad candidate.