What makes teachers decide to teach in real life? A paycheck. Now, that's not the only factor, but it's a big contributor.
I teach for a living and I can tell you no one who is in teaching does it for the paycheck (if you do it for money you are doing it for the wrong reason). The real value in teaching is watching your students grow in your class, gaining the knowledge, and the ability to use it in the real world. I could go off on rants on this, but won't :)
PS-Most who teach could earn a much bigger paycheck in something else, but...decline the monies in favor of the next generation.
You think most teachers would still do that job even if they didn't get paid? You think most could afford to? It's the same as with any other job: getting paid may not be the only factor in taking the job, but it is a big one.
As far as being "underpaid", compared to what? There isn't some canonical pay scale out there to compare things to, but only supply and demand for labor.