Here’s why I think the Supreme Court might be on to something in its Friday decision allowing a group of Muslim and Christian parents to opt their young children out of public-school lessons that feature “LGBTQ+-inclusive texts”: my wife and I sent our kids to private school.

How does B lead to A? Let me explain.

The case before the court, Mahmoud v. Taylor, arose from Montgomery County, Maryland, generally described as the most religiously diverse county in the United States. Part of that rich diversity will include a variety of views on gender and sexuality. When the school board realized that LGBTQ+ issues (and characters) were under-represented in the curriculum, it took a series of measures to present students with a richer spectrum of images and ideas.

So far, so good.

The original proposal included a provision under which parents harboring religious objections to the new materials could opt their children out. In the end, however, the opt-out was abandoned. The suit was filed on behalf of elementary school children by Muslim and Christian parents whose views on gender and sexuality skew traditionally religious.

The parents didn’t ask that the texts in question be banned. They asked that their kids might be excused. The school board responded that the materials did no more than expose the children to new ideas, and that in any case nobody was being coerced.

The Supreme Court, by the now-familiar 6-3 vote, sided with the parents.

Justice Samuel Alito’s opinion for the majority goes on at length about the contents of the materials — “at any point in our lives, we can choose to identify with one gender, multiple genders, or neither gender” one discussion guide explains; in another story the prince rejects the “many ladies” who might rule beside him, and in the end falls in love with a (male) knight — but although I think the court reaches the right decision in the end, I wonder whether this long recital isn’t wide of the point. The majority’s view is that the lessons, in the end, violate the free exercise clause of the First Amendment because the students are coerced; they have no choice but to view and listen to and discuss materials to which their parents have religious objections.

I’m not at all sure, however, that coercion is the right First Amendment test, or, for that matter, that exposure equals coercion.

But I’m equally unpersuaded by the argument that pooh-poohs parental fears, in which families struggling to preserve their own religions against the overweening tides of post-modernity are reduced to something like Kipling’s “lesser breeds without the law,” ignorant savages whose children the school must civilize. The right test is surely the extent to which the ability to raise children in one’s chosen religion is burdened. And there our instinct under the Free Exercise Clause should in most cases be one of deference to the parents.

In her dissent, Justice Sonia Sotomayor presented what lawyers call a parade of horribles — possible bad consequences of the majority’s rule — many of which were drawn from a brief written by people I know and admire. But friends may disagree.

“Teachers will need to adjust homework assignments to exclude objectionable material and develop bespoke exams for students subject to different opt-out preferences,” she writes. “Schools will have to divert resources and staff to supervising students during opt-out periods, too, which could become a significant drain on funding and staffing that is already stretched thin.”

Moreover, she continues, “the majority’s new rule will have serious chilling effects on public school curricula. Few school districts will be able to afford costly litigation over opt-out rights or to divert resources to administering impracticable notice and opt-out systems for individual students. The foreseeable result is that some school districts may strip their curricula of content that risks generating religious objections.”

Let us concede that these consequences are undesirable. But will they all happen? An attractive possibility is that parental objections will turn out to be few, and easily managed; another is that reasonable people, working together, will find reasonable compromises. But if those possibilities seem like so much pie in the sky, we have a much bigger problem than the headaches of administrators charged with running the opt-out program. Because at that point, if parents will in fact seek exemptions willy-nilly for their children, we will have to admit that, at least in the eyes of many families, the public-school project has failed.

And let’s be clear about what that job is. It’s educating the young, but it isn’t just educating the young. It’s working with families to help them raise their children. Schools shouldn’t be competing with parents; they should be collaborating with them. This is particularly true when children are in elementary school, often taking their first steps into the world beyond the one their families have created.

The Supreme Court’s new test, with its implicit suggestion that coercion is found in exposure to materials that go against central tenets of parental religion, is more sledgehammer than scalpel. But if the instrument the majority wields is too blunt, the problem it’s trying to solve is real.

I quite recognize that we live at a time when advances on issues of gender and sexuality are not only under threat but, in some cases, being actively rolled back. But those battles should be fought on their own terms; when it comes to raising children, parental freedom is entitled to a wide berth.

Which brings us back to how B leads to A.

When our children reached school age, we decided on private rather than public education, even though the public schools in our community were top-notch academically. But we wanted more than academics. We wanted them to have an education that would reinforce rather than do battle with the values we sought to teach them at home.

Not everybody can afford those choices; but the public schools should do their best to find ways to accommodate those who wish they could. And, no, my wife and I had no problem with Heather Has Two Mommies, back when that now quaint-seeming book was the big cultural battleground. But I’ve been writing about religious freedom for four decades, and I’m not about to argue that the parents should win only if I agree with them.

Stephen L. Carter is a Bloomberg Opinion columnist, a professor of law at Yale University and author of “Invisible: The Story of the Black Woman Lawyer Who Took Down America’s Most Powerful Mobster.”