British laws, before they're even seen by MPs, are presented to the monarch in what was called Queen's Consent. Now, King's Consent. They can make amendments to the laws before they're even public.
In 1968 the Queen negotiated clauses to the Race Relations Act exempting the Queen and the household from laws that prevent discrimination. They argued that it was "not the practice to appoint coloured immigrants or foreigners".
Far from racism having "no place"; the royal household is built on it.