The Supreme Court ruled Monday that a public law school in California could deny recognition of a student group that bans gay students from membership.

The Christian Legal Society (CLS) was rejected as a registered student group at the University of California's Hastings College of Law in San Francisco because it banned gay students from membership.

Officers and voting members of the socially conservative group are required to sign a “statement of faith” prohibiting “fornication, adultery and homosexual conduct.”

The college's decision excluded the group from receiving school funding and other benefits, which the group argued was a violation of its First Amendment right of association.

Writing for the court's majority, Justice Ruth Bader Ginsburg disagreed: “Compliance with Hastings' all-comers policy, we conclude, is a reasonable, viewpoint-neutral condition on access to the student-organization forum. 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. CLS, it bears emphasis, seeks not parity with other organizations, but a preferential exemption from Hastings' policy.”

Justice Samuel A. Alito was joined by Chief Justice John G. Roberts and Justices Antonin Scalia and Clarence Thomas in his dissent.

Alito called the ruling “a serious setback for freedom of expression in this country.”

The decision is good news for gay rights advocates who worry about the conservative leanings of the court as three cases wend their way to the Supreme Court. All of the cases involve the right of gay and lesbian couples to marry.

Two of the cases challenge the federal Defense of Marriage Act (DOMA), which blocks married gay couples from accessing federal benefits, while a third questions the constitutionality of California's gay marriage ban, Proposition 8.

Advocates fear that a loss in the Supreme Court would irreparably harm the gay marriage movement in the United States.

Last week, the court ruled in favor of gay rights advocates seeking to release the names of signers to a Washington ballot measure that sought to repeal a gay rights law.