As to why they do it? I'm guessing that they either don't know not to bring up race or they don't care about discriminating based on race because they probably won't have any consequences.
I've seen plenty of casual workplace sexism and racism in my life. It happens.
At my previous employer, there were some positions with salaries so low that the only people who applied were foreigners who were so desperate that they were willing to take it. White Americans (and American-born Indian Americans for that matter) with computer science degrees simply had more options than to take such a terrible role at such a terrible salary. It had nothing to do with the company discriminating.
None of what I've said has happened at large companies I've interviewed with like Google or Uber, but small startups definitely have some "interesting" practices.