WASHINGTON (Reuters) - The U.S. Supreme Court said on Monday that it would decide whether a university can deny recognition to a Christian student group because its members must agree with its religious views and it has barred gays and lesbians.

The justices agreed to hear an appeal by a chapter of the Christian Legal Society arguing the U.S. Constitution does not allow a school to deny recognition to a religious student group because it required its members to agree with its core views.

A U.S. appeals court ruled in favor of the University of California, Hastings College of the Law. It denied recognition to the group because it does not conform to the school’s policy that membership should be open to all.

The group required members to sign a statement of faith that vows devotion to Jesus Christ and it barred 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 chapter initially was open to all students, but in 2004 it began requiring members to endorse a statement of faith and barred anyone who engaged in “unrepentant sexual conduct.” The law school withdrew official recognition, but allowed the group to still meet on campus.

A federal judge and then a U.S. appeals court ruled for the law school, holding that its policy was reasonable and “viewpoint neutral” and that it did not violate the rights of the Christian group.

But another federal appeals court, in Chicago, had ruled the other way in 2006 in a case involving a chapter of the Christian Legal Society and the Southern Illinois University School of Law.

By agreeing the hear the case, the Supreme Court is expected to resolve the conflicting rulings. The justices are expected to hear arguments in the case in March, with a decision likely by the end of June.