Companies have a responsibility to make sure harassment doesn't take place.
'Failing to provide a work environment free of racial harassment is a form of discrimination' see https://www.eeoc.gov/laws/guidance/section-15-race-and-color...
Similar to unsafe work places, such as if an accident occurs at work then the business can be held responsible for not caring about safety.