The case centered on what may have looked like a small matter. A transgender fifth-grade girl from Orono was banned from using the girls restroom because a male classmate provoked a reaction from school officials by repeatedly following her in.

Instead of correcting the boy, school officials chose to single out the girl and made her the only student to use a unisex restroom.

For a child trying to understand her gender identity – a question that the vast majority of people never have to confront – it was no small matter. And it wasn’t too small for Maine’s highest court, which issued a strong ruling in the girl’s favor last week that gives good guidance to public officials who are trying to do the right thing.

The case has attracted hysterical reactions from adults who claim it shows the moral decline of the nation or that it creates an opportunity for boys to ogle girls by going into their bathrooms. These opinions are based neither on the law nor on common sense.

Fortunately, the court’s opinion was based on both. The student was born a boy but is now a girl in the eyes of her family, her therapists, her school and the law. The school denied her the right to use the girls bathroom because a fifth-grade boy was teasing her. That is discrimination, according to the court, and it interferes with her right to an education.

The ruling is not a slippery slope for voyeurism. No one should be ogling anyone in a restroom, and if they are, there are laws and school rules that tell officials what to do.

Now there is a court opinion that tells school officials how to protect the rights of all their students. Mainers can thank the girl’s family for bringing this case and the Supreme Judicial Court for its definitive ruling.