No it is not.
According to law of evolution, you want to reproduce your genes. That's includes your relatives genes because a large part is shared with you.
That's why you can have empathy with what you consider close enough.
All that is just natural mechanism.
Now, for some people only themselves matters. For others it is only their close family, for some others it is a wider part of their family, or their race, or the entire humanity, or all the primates, even all the mammal, to all vertebrates (I don't know people caring for a larger scope so far).
That scope, your scope, comes from innate feelings, and acquired feelings (through education, experiences, etc...).
So why would racist people be sick while other are not? They are not even at the extremes of the scope.
So racism is not bad? Yes it bad, because they are lured by the phenotype (the look) of other people. As genetic demonstrated, genes mix between ethnics is far more complex than just the skin color, and a white guy can be genetically closer to a black guy than to another white guy.
TL;DR : for scientific reason (no moral involved in my post):
racism = bad but not a mental illness