Can someone who is racist also have a mental illness? Yes. That doesn't mean racism is a mental illness. I do think, maybe, that mental illness might have be some triggering factors (for some) though, and they share some common similarities. I don't think that's being argued.
I think in a lot of cases, racism is contagious. If you grew up in a household with racism, or hung out with a group of racists, you would learn some of the behaviors. One of my sisters, who grew up in the same household as the rest of my siblings, at one point was racist. The path she chose in life lead her to hang out with people who were bigoted and racist. So most of her viewpoint on things were tinged with a slight racist hue.
The rest of my siblings and I did not share the same group of friends as she did (she hung out with red necks and white trash). She was the first person I ever heard tell multiple racist jokes or make blatantly racist comments.
She and I both suffer from depression and anxiety, but I don't share her racist views (despite apparently some of twitters belief that those on the left are antisemitic). Her behavior was *learned*. When she made the choice to change careers, and further educate herself (she chose not to go to college out of high school, whereas my siblings and I did*), she noticed that the new people she hung out with were now no longer racists people. She went from thinking being gay was an abomination to now being known as the friend who will perform lesbian and gay weddings for her friends free of charge.
It was because she was introduced to people she used to fear/hate, and realized how the're no different than she was.
You can introduce me to as many people without depression and anxiety, and it's not going to change whether or not I have depression or anxiety.
*I am not saying that going to college/being more educated = better or that they're the only people who aren't racist. It's that in this case, she went to work with people who were uneducated AND racist/bigoted. Obviously there are racist people who have PhD's, and not racist people who never finished HS or went to college.