They stay for the same reason you stay in a job where you are vested in retirement and/or building retirement benefits. The free market is definitely at work here. Not all districts pay the same. And, supply and demand is very much at work in the teaching industry as much as any other licensed/certified industry such as plumbers or electricians. Districts only hire teachers if they need them. Where you really have the pork in education is with the upper administration.
I know—my district pays the superintendent nearly $400K a year. . .an amazingly high salary.
If I were a teacher and felt underpaid and overworked I’d get another job—or at least try to—seems like a no brainer to me. Other jobs (such as city and state jobs) have good retirement benefits too.