Hitler was a master at using propaganda to incite fear and then taking that fear and convincing people that he was the only person that could keep them safe. As mentioned above he didn't campaign on the fact that his goal was to destroy a whole population of people.
A couple things:
- First of all, no one knew that Hitler was going to kill 6 million Jews when he was first running for office. He was anti-Semitic, but not to that extent. So they weren't really voting for the Holocaust or anything.
- Second, when you are in a desperate situation, you'll reach for any hope of change. Germany was so badly off economically and so angry (because of having their territory, etc taken by the Treaty of Versailles) that they were willing to vote for anyone who seemed like a change.
Because the electorate was uninformed and desperate and Hitler was brilliant at bitter, emotional speeches and propaganda.
Hitler was fantastic at making big, beautiful promises that he couldn't keep (just like every other politician). Seriously, his lying speeches and over-simplified posters were way ahead of his time. He was an amazing spin-doctor. But his secret agenda was far more diabolical than other politicians. Underneath the marketing, he had plans of devastating cruelty, but he didn't tell the voters that. Not specifically anyway.
In a modern context... Why will so many people vote for Sarah Palin? Because they are angry, desperate and uninformed and she's great at marketing. (She ain't Hitler, but she ain't what she pretends she is.)