Harry Lewis, a former dean of Harvard College, is a computer science professor at Harvard University.

When should traditional liberal values be sacrificed to important but narrower ends? That is the question behind Harvard University’s effort to subordinate freedom of association and freedom of speech to a locally fashionable form of “nondiscrimination.”

Last spring, the university decided to attack the off-campus, all-male Final Clubs by disqualifying their members from Rhodes Scholarships and other distinctions — unless the clubs admitted women. A few of these clubs are infamous for loud parties and drunken misbehavior. The new strategy against them had the merit of novelty, even in the absence of evidence that coed clubs would behave any better.

Faculty members reacted with alarm, recalling Sen. Joseph McCarthy’s persecution of Harvard professors in the 1950s simply for belonging to a hated organization. Students deserve a better lesson from Harvard than an attempt to solve social problems by blackballing members of unpopular groups.

The policy covers all “single-gender social organizations” consisting of Harvard students, so the same sanctions would be visited on women’s clubs, including sororities. More women than men are affected, even though most of the women’s clubs don’t have real estate, much less raucous parties. Hundreds of women staged a surprise protest in response.

The current rationale for punishing single-gender groups is that they are discriminatory. Problems that the policy was initially supposed to address — sexual assault, elitism, drunken parties — have fallen away under scrutiny, leaving gender exclusivity as the clubs’ irreducible sin. As a university official stated, “Our commitment to a non-discriminatory experience is unwavering.”

That invites serious thought about discrimination.

Most of the newer clubs arose as the Harvard student body became more diverse. They come, go and change as students and social mores change. They receive no Harvard funds. One alumnus who had been an immigrant student on scholarship described his multiethnic, multinational fraternity as a comforting “ragtag group of misfits.” Students whose high school classmates joined fraternities and sororities at state universities resent the implication that doing so at Harvard makes them shamefully discriminatory.

I asked some female students what they thought. “Well, I am in a sorority,” one said. “You can guess what I think.” When I pressed her, she icily responded, “Give me a break. I’m a math major. I am the gender inclusivity in most of my classes. After being taught by men and surrounded by men all day, I don’t need a lecture from Harvard about hanging out with women at night.” There is, in fact, not a single tenured woman in the Harvard Mathematics Department.

In response to such resistance, Harvard last month delayed enforcing the policy against women’s groups, but not men’s. The “unwavering” institutional commitment to nondiscrimination will be implemented in a curiously and perhaps unlawfully discriminatory manner.

Don’t students have the right to associate with whomever they want off campus? President Drew Gilpin Faust thought not, darkly comparing freedom-of-association arguments with the tactics Southern racists used to preserve segregated schools.

American society still accepts single-gender institutions such as Faust’s alma mater Bryn Mawr College, long after turning against all-white organizations. Harvard is coed, but even at Harvard race and gender aren’t parallel categories. Men and women are roomed separately but ethnic groups are not intentionally segregated. Gender may be a social construct, but when it comes to the tensions of physical proximity, gender does have something to do with sex.

Using “nondiscrimination” as a cudgel against students’ private associations is odiously patronizing. No similar policy applies to Harvard faculty or staff. Even worse, Harvard will compel students seeking scholarships and leadership positions to affirm their compliance with the policy — to respond to a McCarthyesque “Are you or have you ever been a member” question, under the threat of punishment for perjury.

Harvard prohibits such questions in job interviews. It is an old authoritarian trick to compel speech and then punish lies, a trick Harvard has a history of resisting. For decades, Massachusetts teachers had to swear their loyalty to the Constitution — until MIT and Harvard professors refused in the 1960s and the law was overturned.

Could Harvard today require oaths about club memberships but resist if the government required students to swear that they are lawfully on U.S. soil?

In civil society, freedom of association is built into the Bill of Rights because the state does not always know what is best for individuals. It is an expression of American confidence that even when authorities disapprove, the energy of heterodox private associations improves society in the long run. And freedom of speech includes the freedom not to be compelled to speak.

Ironically, Harvard is now in the process of writing a reference to the Puritans out of its alma mater — to update the anthem “for the 21st century” — even as it reasserts their practice of harsh, intrusive judgments on private lives. A backlash is arising against this institutional overreach. Students, faculty and alumni are marshaling venerable liberal values — freedom of thought, of association and of speech — against a twisted new nondiscrimination orthodoxy.