As long as there is no disruption or distraction of the class, students must be allowed to record classroom activity.
A competent teacher would never object.
Generally, wiretap laws apply.
California, where this took place, is one of 10 states requiring every party to a conversation to consent to recording (known as "two-party consent").