Last month, after school started, a New Mexico teacher was caught in an audio recording denouncing President Trump in class. "If you have a history teacher teaching you that Trump is good, then I feel really scared for you," the teacher said, in response to a 10th grader's question.

The school district's superintendent said he was "very concerned" about the teacher's comments, but he had "no problem" with students secretly recording her.

I've got a problem with both. The teacher should be disciplined if she was trying to slant her students against President Trump, which violates her professional duty to educate rather than propagandize. But students should also be prevented from surreptitiously recording in our classrooms, which deprives teachers of their professional discretion.

It's a vicious circle. We don't put enough trust in our teachers, so we empower students to spy on them. And every time a teacher violates her professional trust, the campaign to spy on teachers gets stronger.

Last June, a New York high school teacher was reprimanded by the city's Department of Education for calling President Trump a "rapist" and a "dictator." The teacher also mocked a student who wore a pro-Trump "Make America Great Again" hat. How do we know? A student made a recording of his remarks, of course, and sent it to school investigators.

In North Carolina, meanwhile, a teacher was caught on video last year telling her class that "the only people who seem to be safe" from Trump are "white Christian males." The video caused an uproar when it was posted online, and the teacher resigned.

And it's not just anti-Trump teachers who have been secretly recorded. Last fall, a few days after Trump was elected, an audio recording surfaced of a Los Angeles substitute teacher gleefully telling students that their parents would be deported.

In all of these cases, school officials noted — correctly, of course — that the teachers' behavior was inappropriate. But nobody pointed out that it was also inappropriate for students to record them.

And if you think otherwise, consider what happened to California teacher Virginia Franklin in 1963. With the Cold War still blazing, Franklin had come under fire from the American Legion for assigning articles that criticized as well as praised U.S. nuclear policy vis à vis the Soviet Union. "She tells the students, 'Here's democracy and here's communism. Choose what is right,'" a local Legion commander complained. "I don't believe we should do that in this country. There's too much chance of influencing the wrong way in the classroom."

In other words, Franklin's foes didn't trust her to teach in a fair and honest fashion. So they sent a student into her classroom to secretly record her. In those distant days before cell phones, the student hid a tape recorder inside a hollowed-out textbook.

But the move backfired. Local citizens were so outraged by the clandestine spying on Virginia Franklin that they voted down a conservative slate of school board candidates, electing a board that firmly backed her. "Yes, Virginia, there is a Santa Claus — to be found in the essential integrity and fair play demonstrated by the people," exulted one school official.

So why doesn't the secret recording of teachers today generate similar outrage? Part of the reason, of course, is that we've all become more accustomed to intrusions on our privacy. When everyone carries a recording device in their pocket, many people simply assume that they might be recorded.

But our classrooms are different — or, at least, they should be. We can't expect our teachers to do their job well if they are always looking over their shoulders, wondering which of their comments might be broadcast to the world. They need the freedom to explore that world — in all of its complexity and controversy — with their students.

And with freedom comes responsibility, of course. Teachers have a right to share their opinions, but they must identify them as opinions rather than as the gospel truth. And most of all, teachers must make it clear that their students don't have to agree with them.

I don't know if the New Mexico teacher made room for other points of view in her classroom, or if she demanded that her students adopt hers. But here's what I do know: If students are allowed to record her, without her knowledge or approval, it's not really her classroom anymore. She will become a paid mouthpiece, not a real professional.

That was Virginia Franklin's worry, too. Addressing a teacher's convention in 1964, the year after she was surreptitiously recorded, she put her finger on the real problem. "There was a total lack of respect for the teacher's role as a member of a profession," Franklin said.

There still is. In our own difficult political moment, teachers need to recommit themselves to letting students make up their own minds. And the rest of us need to trust our teachers, and listen to them.

Jonathan Zimmerman teaches education and history at the University of Pennsylvania. He is the author (with Emily Robertson) of "The Case for Contention: Teaching Controversial Issues in American Schools" (University of Chicago Press).