JE’NAN HAYES played all season on her Montgomery County high school basketball team without incident. But when she showed up for a regional final game this month, she was benched when a referee invoked a seldom-enforced rule requiring her to have documentation for wearing a hijab, part of her Muslim faith. Understandably, she broke down in tears.

A hijab is also the reason that Samira Achbita was fired from her job as a receptionist for a security-services firm in Belgium. She told the company, for which she had already worked for three years, that she wanted to start wearing a headscarf at work, but her bosses refused to allow it, saying there was an “unwritten” rule against it. She started wearing one anyway, and the day before the company turned the unwritten rule into a written one, Ms. Achbita was fired. The European Union’s highest court this week turned aside her complaint of religious discrimination.

We are shaking our heads at this foolishness. What on earth was that referee thinking in insisting — against the entreaties of the girl’s basketball coach to use common sense — that she needed a signed waiver to prove her head covering was for religious reasons? Doesn’t that firm in Belgium recognize the harm of judging the value of a person by what they wear? And why didn’t the European Court of Justice give voice to the need for tolerance in the workplace?

It is of some comfort that Maryland school athletic officials didn’t even try to defend the events of March 3 that stranded Je’Nan on the bench. Sheepish about the rigid reading of the rulebook, they agreed the girl should have been allowed to play. It is of comfort, too, that Dutch voters on Wednesday did not elevate their most intolerant party into a position of power. But these are struggles that will not be ended with one election or one court case.

There are situations when rules about what can be worn make sense, for safety or security reasons. But banning headscarves, which the European Court of Justice seemed to greenlight as long as they aren’t singled out from other religious garb, serves no purpose other than to separate and penalize. That is harmful not only to the individual being singled out but also to society at large, which is better served by inclusiveness.