Protesters shout before conservative commentator Ben Shapiro begins his speech at the campus of the University of California at Berkeley in September. (Josh Edelson/AP)

When I was a sophomore in college, the College Republicans invited Phyllis Schlafly, the conservative political activist best known for her campaign against ratification of the Equal Rights Amendment, to give a speech on campus. There were no barricades around the building where she spoke. Beyond a few campus police officers, there were no state police in riot gear. Bags weren’t checked at the entrance. And most of all, no one shouted her down on one of the most liberal college campuses in the country.

Compare that with the scenes that have played out on campuses over the past year at the University of Virginia, the College of William & Mary and the University of California at Berkeley, among others, where appearances by controversial speakers resulted in protests with armed police officers reminiscent of a war zone, with students doing their best to interrupt speakers — all at a great cost to some cash-strapped universities. The University of California at Berkeley said a visit last fall by the conservative writer Ben Shapiro cost more than $600,000 in preparations and security. (The university system agreed to cover half that bill.) By the way, the university ended the fiscal year with a $77 million deficit.

If incidents like these seem more common nowadays on college campuses, chalk it up partly to student attitudes toward the First Amendment and free speech. A new survey released Monday from Gallup and the John S. and James L. Knight Foundation reveals that students have a tenuous relationship with the First Amendment.

The poll of 3,000 U.S. college students found that they generally endorse the ideals of free speech and campuses that encourage the discussion of a variety of ideas. But once that speech begins to infringe on their values, they’re likely to support policies that place limits on speech. Those include free-speech zones, speech codes and prohibitions on hate speech. Only a slight majority (53 percent) think that handing out literature on controversial issues is “always acceptable.”

The Supreme Court has consistently ruled that the First Amendment means public institutions, including state colleges and universities, cannot exclude speakers or punish speech just because it is hateful or offensive. Yet 37 percent of college students in the poll said that shouting down speakers was acceptable, at least sometimes. Another 10 percent said it was acceptable sometimes to use violence to prevent someone from speaking.

It is notable that some of the biggest debates about free speech in the past year occurred at Berkeley, home of the Free Speech movement in the 1960s. Back then, however, the students were the ones who wanted to speak out and the administrators were the ones who tried to stop them. Now the roles are reversed.

In November, when I moderated a panel of campus leaders on this subject, including Carol Christ, the University of California at Berkeley’s chancellor, and Rebecca Blank, the University of Wisconsin at Madison chancellor, they were the biggest defenders of free expression on campus.

The new Gallup survey is a follow-up to a similar one taken in 2016, and pollsters noted how opinions have shifted in just a few years. Support for campuses that promote a variety of views has dropped.

Some scholars have noted that one reason current college students are ambivalent, sometimes even hostile, to the idea of free speech is that they were a generation raised to recognize that bullying is wrong. They equate hurtful speech to bullying, said Erwin Chemerinsky, dean of the University of California at Berkeley’s law school and co-author of a book released last year called “Free Speech on Campus.”

Another reason is social media. The Gallup survey found that social media is a critical part of the lives of college students, and it has shaped their opinions on free speech.

“There’s a strong suggestion from this study that college students are souring on social media,” Brandon Busteed, executive director of education and workforce development at Gallup, told me. “Students are much more likely to report having discussions of political and social issues on social media rather than in public areas of campus. This is a huge challenge and opportunity for both students and higher education leaders to bring this dialogue back to campus.”

More than 6 in 10 students in the poll said the dialogue on social media usually isn’t civil, and increasingly students think that social media can stifle expression because of a fear of being attacked or because people block those they disagree with.

Whatever the reason for students’ ambivalence on the First Amendment, the free speech battles on campus playing out in the public arena — and sometimes promoted just for that reason — seem to be having a larger impact on higher education. In the past few years, several national surveys have found an erosion of support for colleges and universities. One survey in particular last summer from the Pew Research Center showed that 58 percent of Republicans and right-leaning independents think colleges have a negative impact on the country.

The skepticism about higher education is stronger on the right, but it comes from both sides of the political spectrum. No wonder that public funding of state universities is being slashed in many states or that last year Congress agreed to tax the earnings on the endowments of some universities.

College students, of course, are only passing through campus for a few years, so they don’t usually think about the larger consequences of their actions and how they might be perceived by external audiences.

And to be fair, most of the free speech protests have occurred at a small number of relatively affluent, elite colleges, a Brookings Institution study concluded last year.

Unfortunately, not enough college students on enough campuses are protesting with as much passion about the things that directly affect them: cuts to state budgets, taxes on endowments and proposals before Congress right now to revise federal student loans.