Remember that racism is a created concept. Man has always had thoughts, and the part of those thoughts that may offend those of a different skin colour for example, has been called 'racism.' But racism is something that is bad only when people hear it. When you think it, it's OK, because no one knows. It doesn't stop people being racist, it stops them from talking.
When it comes to elections, the ones you hear more are the ones who shout the loudest, and the ones who shout the loudest do so because they talk of sensitive subjects. In the US election, the Democrats shouted the loudest because they accused Donald Trump of being racist. Yes, he has said some silly things, but we hear that because he just says what he thinks. When you accuse someone of being racist, everyone listens. You only hear the worst, and only what the press reports and what social media talks about. Trump is not racist because the reason that he wants to restrict illegal immigration and have tighter border controls is security, not xenophobia.