So holds Christian Legal Society v. Martinez, in a 5-4 opinion; the majority consists of the liberals plus Justice Kennedy. I think this is the right result as a constitutional matter — even when the university rule ends up barring a religious group from selecting members and officers based on religion and sexual orientation — see this article, though I can’t yet speak to the means through which the majority arrived at the result. (As I mention in the article, I think having such broad rules is often a bad idea, and bad for diversity of opinion and culture on university campuses, but that’s a separate question.)
UPDATE: I originally described the Court’s decision as dealing with nondiscrimination policies, but I’ve updated the post to be more precise: The Court treats the Hastings policy at issue in the case as a requirement that student groups accept all students, “regardless of … status or beliefs,” to the point that “for example, the Hastings Democratic Caucus cannot bar students holding Republican political beliefs from becoming members or seeking leadership positions in the organization.” The Court concludes only that this policy is constitutional; it does not directly opine on whether it would be constitutional for the university to have a policy that only bars discrimination based on race, religion, sex, sexual orientation, and the like (and that thus lets groups discriminate based on other criteria, such as a student’s beliefs that do not fall within the rubric of “religion”).
Sorry for the initial imprecision; I’ve been focusing first on the Second Amendment incorporation case, and I’m just now getting to read the Christian Legal Society case.