This section of the regulations has undergone a few amendments over the years. It tries to strike a balance between honoring the "non pecuniary" aspect of amateur radio with the practical needs for education, information and practice.
As it relates to teachers in a recognized educational institution, it would not be permissible for a teacher to transmit from an amateur radio station for the purpose of regular QSOs if their paid position is, for example, a full time station trustee. This would be pecuniary. On the other hand, if a teacher is teaching an electronics course or a ham radio course and wishes to show students how a ham radio station works, this is permissible. Since it is incidental to the activities of the teacher, the FCC permits this in order to promote people developing an interest in the hobby.
You may enjoy some of the other interesting allowances in the regulations that avoid the pecuniary trap - take a look at section 97.113(a)3. If you don't have a copy of the current Part 97 regulations, you can find them at
http://www.arrl.org/files/file/Regulatory/March%208,%202018.pdf. One interesting exception that is practiced but not codified is astronauts making QSOs while being paid to be on the space station.
- Glenn W9IQ