The high court voted 5-4 to uphold Hastings' policy of requiring officially recognized student organizations to open their membership to all students.
"I've always believe it's wrong for us to tell our students, 'You're welcome here, but there are certain aspects of the Hasting experience you can't do. And by the way, we're paying for them,'" Dean and Acting Chancellor Leo Martinez said.
"The only way sane way to run an institution is to make sure the programs we provide are open to everyone," he added.
The court majority affirmed the law school's decision to deny recognition to the Christian Legal Society, which bars members who are nonbelievers or who engage in "unrepentant homosexual conduct."
Justice Ruth Bader Ginsburg wrote, "Compliance with Hastings' all-comers policy, we conclude, is a reasonable, viewpoint-neutral condition on access to the student-organization forum."
Hastings is part of the University of California system.
The Christian Legal Society, a nationwide group based in Springfield, Va., claimed in a 2004 lawsuit that the policy violated its constitutional rights of free speech, association and religion.
It appealed to the Supreme Court after a federal trial judge in San Francisco and the 9th U.S. Circuit Court of Appeals ruled in favor of Hastings.
Kim Colby, a lawyer for the society, said today, "All college students, including religious students, should have the right to form groups around shared beliefs without being banished from campus."
The high court majority said the group's rights weren't violated because it can still meet on campus and can still exclude any members it wishes if it decides to forgo the benefits of official recognition.
Justice Samuel Alito said in a dissent that the ruling "arms public educational institutions with a handy weapon for suppressing the speech of unpopular groups."
Both officially recognized and nonrecognized student groups at Hastings can meet in rooms at the school and post notices on a school bulletin board.
Official groups can also announce meetings in a weekly school newsletter, use Hastings in their name, recruit members at an annual school fair and apply to the student government for a small amount of event financing from a fund paid by student fees.
Martinez said the law school currently has more than 70 officially recognized groups. He said he did not know how many non-recognized groups there are.
The student fee fund used to support student organization events contains $6,000 to $7,000 each year, he said.
The high court did not rule on a second argument in which the Christian group contends that Hastings enforces its nondiscrimination policy selectively. The panel sent that part of the case back to the 9th U.S. Circuit Court of Appeals in San Francisco for further consideration.