Mainstream liberal media were all stunned by Trump's victory in spite of their unceasing and relentless demonizing of Trump as being a racist, a bigot, etc. etc.

It appears that mainstream liberal journalists can not accept a presidency of Donald Trump ergo this so-called "racism", one of the very thing to demonize Trump during the election campaign.

But on the question - Why did people vote for Trump

Simple:  
(1) Build the wall  
(2) Renegotiate trade agreements 
(3) Drain the Swamp.

Racism?  

How can one even think of racism when Trump intends to tackle low income African-Americans and Latinos in inner cities in his "Make America Again" programs.