Let’s face it. Trump pandered to racists because a significant portion of his base is racist. Just as his own dishonorable lying has communicated to America that lying is good, Trump has done much to suggest that racism is (once again) an acceptable thing. He has emboldened the racists of the alt-right to come out of rotted woodwork they once inhabited and into the open.
With things like his reaction to Charlottesville, his pardon of Arpaio, his Britain First tweets, and so on, Trump continues to communicate to his racist alt-right base that he is on their side.