Why were the presidential polls so wrong?

Pre-election polls predicted Hillary Clinton would win several states that ultimately went to Donald Trump. How did they get it wrong?