WASHINGTON (Reuters) - The Supreme Court considered on Monday whether a university can legally deny recognition to a Christian student group that excludes gays and nonbelievers.

The high court appeared sharply split as it heard arguments in a case that pits anti-discrimination principles against religious freedom. The case could have important implications for how public universities, colleges and schools must accommodate campus religious groups.

Liberal justices asked whether campus groups could legally exclude women, minorities or those with disabilities while conservatives asked how far universities could go to require that groups admit student members with opposing views.

Conservative Justice Antonin Scalia asked whether a campus Republican club must admit Democrats or whether a Christian group must allow atheists to join and even conduct Bible classes.

“That’s crazy,” Scalia said as the courtroom erupted in laughter.

The case involved the Christian Legal Society, which requires members to sign a statement of faith that vows devotion to Jesus Christ. It bars those with a “sexually immoral lifestyle,” including gays and lesbians.

Founded in 1961, the Christian Legal Society maintained law student chapters across the country. Its members hold Bible study meetings and discuss ways to apply their religious faith to the practice of law.

The University of California, Hastings College of the Law, denied recognition to the group because it does not conform to the school’s policy that membership should be open to all, Washington lawyer Gregory Garre argued on behalf of the university.

Conservative Justice Samuel Alito said forcing the admission of someone who does not share the same religious beliefs could be a threat to the group.

Chief Justice John Roberts drew a distinction between policies against gender and race discrimination and religious beliefs, which are protected by the U.S. Constitution.

Stanford University Law professor Michael McConnell argued on behalf of the Christian Legal Society that the Constitution does not allow a school to deny recognition to a group because it required its members to agree with its core religious views.

Liberal Justice Sonia Sotomayor asked McConnell what was wrong with a university adopting a policy that it does not want to recognize a group if it discriminates.

Justice Stephen Breyer also seemed to support the school. He asked whether the Christian Legal Society would admit a gay student who does not believe in premarital sex.

McConnell answered that a student who believed in same-sex marriage would not be admitted to the group.

A decision in the case is expected by the end of June.