Statutes can outlaw a subset of fighting words as long as that subset of fighting words is not content-based (based on viewpoint). (It gets strict scrutiny, even if the speech is worthless.)
Being motivated by race can be a basis for enhanced sentencing, just not an element of the crime itself.