Last week, the California Supreme Court voted to bar any California state judge from belonging to youth organizations that “invidiously discriminate,” apparently with the Boy Scouts of America in mind. This policy is the latest example of ideologues using government coercion to force public servants to conform their private lives to government ideology—or resign from public service.

Because the apparent purpose of the change in the ethics code is to discourage membership by judges in groups that have conservative views about sexuality, the code violates the spirit—and probably the letter—of both the First Amendment and the California constitution.

The purpose of the California Code of Judicial Ethics is to create rules that keep judges impartial, and inspire public faith in the courts. As a part of this, the code prohibits judges from belonging to groups that “practice invidious discrimination.” This prohibition itself might run into First Amendment problems (“invidious” is vague), but it gets worse. Since 1996, the California Supreme Court has allowed judges to be members of “nonprofit youth organizations” that might otherwise be swept up in the vague “invidious discrimination” standard.

Such an exception was important, the Code itself noted, “to accommodate individual rights of intimate association and free expression.” But apparently these rights are no longer important to the Supreme Court of California, because that section has been struck, and the youth group exception with it.

The California Supreme Court seems to be acting on the assumption that any civil servant who associates with an organization that believes that marriage is the union of a man and woman should be exiled from public service.

Activists contend that the Boy Scouts—one of the nation’s largest youth development organizations, founded to build character and train boys to be active and responsible citizens—engages in “invidious discrimination” because, while they permit LGBT youth to be members, they do not permit adult leaders who are “open or avowed homosexuals.” But this is entirely irrelevant to the governmental interest in preserving a fair judiciary, and so activists have claimed that judges who associate with the organization will be biased. As the Los Angeles Times reports:

James Humes, a justice on the state’s Court of Appeal and an openly gay man, argued that the exception should be abandoned “because it incites distrust in judicial impartiality, demeans gay and lesbian judges and is offensive and harmful.”

This argument fails. The First Amendment (and the California Constitution) protects much expressive conduct that could be considered by some to be demeaning, offensive and harmful. And this protection extends to judges. As Justice Kennedy noted in Garcetti v. Ceballos: “It is well settled that ‘a State cannot condition public employment on a basis that infringes the employee’s constitutionally protected interest in freedom of expression.'”

There is no question that the First Amendment mandates that individual citizens can belong to the Boy Scouts, and that the Boy Scouts can pick and choose its own leadership. So, while the government has an interest in ensuring that judges are (and are perceived as) impartial, the California rule sweeps within its scope purely private conduct that has no bearing upon a judge’s ability to judge.

The California Supreme Court has not pointed to any evidence that volunteering with the Boy Scouts has led to discriminatory conduct. Instead, it seems to be acting on the assumption that any civil servant who associates with an organization that believes that marriage is the union of a man and woman should be exiled from public service—simply because of the association. Why a judge associating with the Boy Scouts should be unfit to judge a contract dispute between two companies is unclear. And even in cases dealing with issues such as gay marriage, there is no problem of partiality that could not be remedied by California’s preexisting rules on disclosure and recusal. Furthermore, it is inappropriate for the government to attempt to remedy an appearance of impropriety created as a sort of “heckler’s veto.” In this case, a few activist organizations raising a fuss does not create a true appearance of impropriety.

The rule of the California Supreme Court, in other words, is overly draconian even if one accepts the governmental interest the Court advances. The rule represents another instance of government discrimination against citizens with traditional moral convictions. Contrary to what the California Court may assert, public servants retain their freedom to belong to private organizations upholding traditional American values, because such membership does not interfere with any compelling governmental interest. If it is ever held that such membership does, per se, constitute such interference, we will no longer be able to continue under the illusion that we are a nation of expressive freedoms.

While certain affiliations might be out-of-bounds for judges (such as being an agent of a foreign government), it is absurd to exclude a volunteer youth organization that has been formative in the lives of so many great Americans.

The majority of Americans understand that wielding governmental authority to silence traditional beliefs is wrong. While some crusaders may want to push those with religious beliefs or moral convictions about marriage out of the public square, most citizens, whether for or against gay marriage, do not want the government using state power to punish people over their beliefs about marriage.

Protecting freedom of association and the rights of conscience is the embodiment of principled pluralism.

Even if state or federal governments recognize same-sex relationships as marriages, Americans should not be punished for their political or moral speech taking the other side of the debate. Government jobs, consistent with the First Amendment, cannot be off limits for those who believe or publicly advocate that marriage is the union of a man and woman, or that sex is reserved for marriage.

Protecting freedom of association and the rights of conscience is the embodiment of principled pluralism. It’s this principled pluralism that allows for a variety of beliefs with no government-imposed orthodoxy. It allows for a more diverse and civil public sphere—and it allows for the tolerance that is essential to promoting co-existence in the midst of disagreement.

Yet this quintessentially American value is increasingly under assault. Last month, Atlanta Fire Chief Kelvin Cochran was fired for his beliefs about marriage. Now, the California code of judicial ethics invites governmental interference in the private lives of state judges. It’s time to protect Americans—especially civil servants—from government discrimination. Will a California judge stand tall and challenge this terrible rule? We can hope.