By Douglas Laycock, Special to CNN

Editor’s note: Douglas Laycock, Professor of Constitutional Law at the University of Virginia, represented Hosanna-Tabor Evangelical Lutheran Church and School in the case the Supreme Court decided Wednesday.

(CNN) - Wednesday’s Supreme Court decision holding that ministers cannot sue their churches for employment discrimination was a huge win for religious liberty. It was unanimous, it was sweeping and it was unqualified.

This decision was about separation of church and state in its most fundamental sense. Churches do not run the government, select government leaders, or set criteria for choosing government leaders.

And government does not run the churches, select religious leaders, or set criteria for choosing religious leaders. The Court unanimously reaffirmed that principle on Wednesday.

Cheryl Perich was a commissioned minister at the Hosanna-Tabor Evangelical Lutheran Church and School in Redford, Michigan. She taught religion every day; she led prayers and devotional exercises every day; she planned and led chapel services.

She also taught the rest of the fourth-grade curriculum. She was required to complete eight college-level theology courses; she was “called” to her office by a vote of the congregation; and she was commissioned as a “Minister of Religion.”

When she got sick, Hosanna-Tabor carried her at full pay and full benefits for seven months. This was a terrible hardship in a church and school with seven teachers, 84 students and deep financial problems.

In its effort to preserve a job for Perich to return to, the school put three grades in one classroom for a whole semester. It went far beyond the requirements of law in its efforts to accommodate her disability.

Finally, at the semester break, the school reluctantly decided it had to replace her. When she provoked a confrontation at the school and threatened to sue the church, the congregation rescinded her call, for insubordination and for violating one of the church doctrines she was supposed to teach and model.

There was a well developed church grievance process that she could have used, run by the denomination, with hearing officers independent of the local church.

And there was longstanding church teaching that disputes over ministry must be resolved in that process, by Lutherans who understood the church and its faith, and not by the civil courts.

The details of this employment dispute were not the issue in the Supreme Court. Rather, the issue was who decides.

If ministers were allowed to sue for employment discrimination, judges and juries would wind up deciding who is a good minister, worthy of retention, and who is not. These cases end with a jury deciding whether the employer had a good enough reason to justify its decision.

In Perich’s case, a jury would have decided whether she was fit for Lutheran ministry even after she defied Lutheran teaching.

The Supreme Court unanimously said that ministers cannot sue their churches for employment discrimination. It defined “ministers” broadly, to include priests and rabbis and imams and persons with mixed religious and secular duties.

And it said that the church need not explain its decision, because the reasons are none of the court’s business. The selection and retention of ministers is entirely the responsibility of the churches.

Some churches will exercise this authority wisely; some may not. Denominations and associations of churches would do well to establish grievance procedures that really work, like the one that Cheryl Perich failed to use.

But whatever the ratio of wise decisions to bad decisions, it is far better for the American tradition of religious liberty for the selection of ministers to be entrusted to the churches those ministers serve.

Wednesday’s decision also protects the right of churches to define the qualifications of their clergy. Some churches have requirements that are forbidden to secular employers.

Catholics, Orthodox Jews, and some Protestant denominations do not ordain women. Catholics require celibacy, violating laws on marital status discrimination in many states. Some denominations refuse to ordain sexually active gays and lesbians, violating sexual orientation laws in many states.

There are no exceptions written into the discrimination laws to protect these longstanding religious practices. They have been protected only by the constitutional rule that the Court reaffirmed Wednesday – that ministers cannot sue their churches for employment discrimination.

Of course, some members of these faiths would like to change these rules. But who is eligible for ordination is a theological issue to be fought out within each religious tradition, not an issue to be decided by courts or legislatures.

It would be absurd for courts to order an end to Catholic celibacy rules, or to entertain a class action alleging that women are underrepresented in the clergy of some denomination that ordains women but has not ordained as many women as men. The legal rule that prevents such lawsuits is the ministerial exception that the Supreme Court reaffirmed Wednesday.

Both the rules for selecting ministers, and the evaluation of ministers in individual cases, are decisions for the nation’s religious organizations – not the government. That is the welcome meaning of Wednesday’s Supreme Court decision.

The opinions expressed in this commentary are solely those of Douglas Laycock.