Alabama Republican Chief Justice Roy Moore is fighting to keep his job. He's accused of violating judicial ethics for telling local judges they were bound by Alabama's gay marriage ban — and not the U.S. Supreme Court's landmark ruling legalizing same-sex marriage.

His trial is set to start Wednesday. He's been suspended pending the trial, and faces removal from the bench.

"Roy Moore doesn't know the difference between being a judge and being a preacher," says Richard Cohen, president of the Southern Poverty Law Center. The Alabama-based group filed several ethics complaints over Moore's conduct.

"He thinks his religious beliefs should trump his obligations under the law, and that's a dangerous thing," Cohen says.

Moore forced the debate last year when he issued orders in conflict with a Mobile, Ala., federal judge's ruling that struck down the state's ban on same-sex marriage. Here's what he told NPR at the time:

"If we sit back and let the federal courts intrude their powers into state sovereignty, then we're neglecting everything about which the Constitution stands," Moore said.

The result was confusion in marriage license offices throughout Alabama. Some closed down altogether. Even after the U.S. Supreme Court affirmed marriage equality, Moore told local judges that they had a "ministerial duty not to issue any marriage license contrary to" state laws forbidding same-sex marriage.

Now Moore is defending himself against several ethics charges, including failing to act with impartiality, independence and integrity; and failing to respect and comply with the law.

Moore argues he didn't tell local judges to disobey the Supreme Court, only that there remained a conflict between state and federal court orders.

Moore's attorney is Mat Staver, founder and chairman of Liberty Counsel, a Florida group that litigates conservative Christian causes.

He says Moore is being targeted for his religious views.

"This is a politically motivated complaint," Staver says. "It's no doubt in this case. The Southern Poverty Law Center has a complaint against the chief justice because of his views on marriage."

Moore has been here before. He was ousted on ethics charges in 2003 after defying a federal court order to remove a giant Ten Commandments monument from the Alabama judicial building. Voters elected him chief justice again in 2012.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.