Updated

A small-town judge who says her religious beliefs prevent her from presiding over same-sex marriages was publicly censured by the Wyoming Supreme Court on Tuesday.

But while the court said her conduct undermines the integrity of the judicial system, it does not warrant removal from the bench. In a 3-2 decision, Justice Kate Fox wrote that Judge Ruth Neely violated judicial conduct code but removing Neely would "unnecessarily circumscribe protected expression."

"Judge Neely shall either perform no marriage ceremonies or she shall perform marriage ceremonies regardless of the couple's sexual orientation," Fox wrote.

Neely has never been asked to perform a same-sex marriage, and Fox said that the case was not about same-sex marriage or the reasonableness of religious beliefs.

"This case is also not about imposing a religious test on judges," wrote Fox, who was joined in her opinion by Justices E. James Burke and William Hill. "Rather, it is about maintaining the public's faith in an independent and impartial judiciary that conducts its judicial functions according to the rule of law, independent of outside influences, including religion, and without regard to whether a law is popular or unpopular."

Neely's case has similarities to legal action against a Kentucky clerk of court jailed briefly in 2015 after refusing marriage licenses to gay and lesbian couples. The case against clerk Kim Davis, a conservative Christian, sparked a national debate over the religious freedom of civil servants versus the civil rights of same-sex couples. Davis ultimately agreed to alter the licenses to remove her name and title.

In Neely's case, the dissenting justices argued that Neely didn't violate any judicial conduct code. "Wyoming law does not require any judge or magistrate to perform any particular marriage, and couples seeking to be married have no right to insist on a particular official as the officiant of their wedding," Justice Keith Kautz wrote in the dissent that was joined by Justice Michael K. Davis.

Neely, who's not a lawyer, is a municipal judge in Pinedale, a town of about 2,000 residents, and a part-time circuit court magistrate in Sublette County, a rural county rich in outdoor recreation and oil and gas. The majority of her work as a magistrate is to perform marriages.

The Wyoming Commission on Judicial Conduct and Ethics had recommended that Neely be removed from her positions for violating the state code of judicial conduct. Neely had argued that removing her would violate her constitutional rights.

Because Neely is a part-time magistrate appointed by a local circuit court judge to handle particular court needs, the Supreme Court left it to the discretion of the circuit court judge whether Neely can "continue to serve the essential functions of that position."

The circuit court judge who oversees Pinedale was not available for comment Tuesday, according to his office.

Attorney James Campbell, who represented Neely, said in a statement that Neely looks forward to serving her community for years to come.

"By affirming that Judge Neely may remain in her judicial positions, the Wyoming Supreme Court has recognized that her honorable beliefs about marriage do not disqualify her from serving her community as a judge, which she has done with distinction for more than two decades," said Campbell, who is an attorney with the Alliance Defending Freedom, an Arizona-based religious advocacy law firm.

Patrick Nixon, an attorney for the Judicial Conduct and Ethics commission, did not immediately return a message seeking comment. Commission Executive Director Wendy Soto declined to comment on the case and what the censure means for Neely.

The Supreme Court opinion noted that judicial discipline serves multiple purposes, including discouraging further misconduct by the judge and reinforcing the perception that judicial ethics are important.

Jason Marsden, executive director of the Denver-based Matthew Shepard Foundation, which advocates for gay rights, said the foundation believes that any public official must serve members of the public equally, regardless of personal beliefs.

"We would simply ask the circuit court to remain watchful to ensure that there is no discrimination from the bench for any of the citizens in her jurisdiction should she continue to serve," Marsden said.

The ethics commission investigated Neely after she told a reporter in 2014 that she wouldn't preside over same-sex marriages. Her lawyers said no same-sex couples had asked her to perform their marriage before she made the comments to the local newspaper. The U.S. Supreme Court ruled in 2015 that same-sex couples nationwide may marry.