It's acceptable (if short-sighted) to exclude people for being racist. It's not acceptable to exclude people for being poor and uneducated. The Democrats messed up by ignoring the pain of poor people, not by being insufficiently tolerant of racism.
The fact that Sanders was predicted to do significantly better than Clinton against Trump means that there's plenty of votes to be won by listening to poor people without being racist.