A lot of jobs are underpaid such as teachers they do it because they love it. I was underpaid as a auto mech I loved working on cars but its not worth hearing crap from customers and bosses glad I'm not doing that anymore
I can't speak for teachers because I am not a teacher, however, anyone that works would want to be fairly compensated for the work that they do.
If you are grossly underpaid, then you feel under-appreciated, which will lead you to make a decision to stay because you love the work you do, despite the low pay, or you leave and find a better job.
So to answer your question, if you're a teacher, and you feel you're underpaid, you might feel resentful. You might not be able to control your resentment. Your students might notice this and do poorly in class. This might lead the principal to step in and scold you to bring you back in line. And you're back to feeling resentful and now angry that the principal has talked to you about your attitude.
If it does, it is rarely so. Most teachers teach because they want to. No one does it for the money.