The folks over at Planet Money took a look at where different professions come from (in terms of household income when they were growing up) and where they end up.
Teachers, for example, come from homes just below the 60th percentile, and then earn incomes that are roughly at the 65th percentile. [Red box at center of chart.] That is, they start out above average and out-earn their parents combined income (if they had two working parents) as adults.
To be sure, there are folks who enter other professions make even larger generational leaps (see top of chart), and folks who enter professions where they tend to make less than their parents did when they were kids.
But the chart also makes clear that teachers don't generally come from low-income homes similar to the students that they teach (in places like Chicago, LA, and NYC at least) and aren't (to the extent this data is accurate) impoverishing themselves relatively speaking by becoming teachers.