The U.S. Supreme Court has upheld a law school’s policy requiring all comers to be admitted to officially recognized student groups.

Justice Ruth Bader Ginsburg wrote the majority opinion (PDF), SCOTUSblog reports. She was joined by four other justices.

The Christian Legal Society had contended its First Amendment rights of free association were violated when the University of California’s Hastings College of the Law refused to recognize the group. The case had pitted the law school’s right to enforce its nondiscrimination policy against the right of a Christian legal group to exclude gays and nonbelievers.

“Compliance with Hastings’ all-comers policy, we conclude, is a reasonable, viewpoint-neutral condition on access to the student-organization forum,” Ginsburg wrote. “In requiring CLS—in common with all other student organizations—to choose between welcoming all students and forgoing the benefits of official recognition, we hold, Hastings did not transgress constitutional limitations.”

The American Bar Association had filed an amicus brief supporting the law school in the case, Christian Legal Society v. Martinez.