I think that’s in accordance with the law, and I think that’s how it works in practice too. Healthcare professionals regularly treat rapists and murderers, Nazi sympathizers, avowed racists and other “undesirables” without complaint, as long as they sit still and don’t get (too) mouthy while they’re being treated, as a retired doctor just pointed on here.
For the record I’m grateful they do and I’d be horrified if they didn’t.
As far as the “your attitude makes me feel unsafe” argument, that seems hard to land in the context of a patient. As long as the patient sits still who has time to care what’s in their head? And a security guard is available for violent patients (of which hospitals have a lot of experience - and I’m sure the violence is the issue, not the racist attitude that might accompany it).
It gets more complicated when someone says they don’t want to be seen by a male doctor, rather than a Jewish doctor because we all see that as more legitimate and the NHS does too, no? Then when you mix in that different people understand “male” in different ways it gets even more complex to unpick.