Let me explain the idea of probability to you.
Lets take 538 which is a favorite. They gave Hillary a 65-70% chance of winning if I remember correctly. So that means that if you flipped a coin 10 times and called tails, there is a 6-7 out of ten chance it will land on tails. Now it doesn't mean that during that specific sequence of ten flips you will get 6-7 out of ten. During one sequence you may get 8 out of ten while in another you may get 4 out of 10. However, if you were to take many sequences and tease out the data, you'll get 6-7 out of 10 more times than not.
This does not mean you will never get heads if you called tails. In this case, we got heads when tails was being called.
To go on about 538 a bit more, they got some shyt after the election but they were the only people who made the claim based on their models that there was a chance Hillary would lose the Election but win the popular vote.
Here is an article they wrote on Nov 1st.
The Odds Of An Electoral College-Popular Vote Split Are Increasing
Also should mention that near the end of the race, Hillary was only leading by 2-5 points in a lot of polls which for a lot of polls was within margin of error and this was national polls. However in the states she lost, the race was well within margin of error more so than the national polls. Also her popular vote lead is very close to the national poll point leads.
In short, a lot of polls weren't "wrong" because they weren't making predictions. They were providing statistical likelihoods.