Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The Wyoming Supreme Court Tuesday censured a state judge for publicly stating her refusal to perform same-sex marriage ceremonies, citing religious objections.

By a 3-2 vote, the court said Ruth Neely, a magistrate in the small northwestern Wyoming town of Pinedale, violated the state's code of judicial conduct.

"No judge can turn down a request to perform a marriage for reasons that undermine the integrity of the judiciary by demonstrating a lack of independence and impartiality."

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Ruth Neely Town of Pinedale

The court said she must either "perform marriage ceremonies regardless of the couple's sexual orientation," or decline to perform any marriage ceremonies at all.

The state's judicial ethics commission recommended that Neely be relieved of her position as a magistrate after she told the local newspaper that she would "not be able to do" marriage ceremonies for gay couples.

"When law and religion conflict, choices have to be made," she told the Pinedale Roundup.

In a letter to the state's judicial ethics advisory committee, she wrote, "Homosexuality is a named sin in the Bible, as are drunkenness, thievery, lying, and the like. I can no more officiate at a same-sex wedding than I can buy beer for the alcoholic."

The state supreme court declined to remove her from her position, based on her long career as a municipal court judge "for which she is widely respected." Her misconduct was an isolated response, the court said, "to a quickly changing legal landscape, one in which many judges have experienced similar turmoil."

Firing her would "unnecessarily circumscribe protected expression," the majority opinion said.

Her lawyer, Jim Campbell of the Arizona-based Alliance Defending Freedom, said the court "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.

Tuesday's ruling said every state judicial ethics commission that has considered the question concluded that judges violate codes of judicial conduct when they refuse to perform marriages for same-sex couples.