I see what you are saying, but not publishing the materials is not going to solve the problem. That's because the people who are attacking the professors will just get it by some other means, like having someone attend the class.
Remember, the attackers are not a few oddballs. The are members of a vast MAGA movement that has enough member to elect the present president and that encourages this sort of behavior. And they have tons of money behind them.
> will just get it by some other means, like having someone attend the class.
Not really, they don't have sufficient time budget and a network of agents to do that as comprehensively as with a simple "google search" some bureaucrat/activist can perform in a few minutes
> And they have tons of money behind them.
Sure, and each dollar has plenty competing uses