Earlier quoted context omitted.
Teaching is an incredibly valuable job. But it isn't really subject to market forces the way software engineering is. A better teacher doesn't bring in more revenue and profit for a public school. Most teachers work in public schools. I am not disagreeing with you in general (I am not taking a stand either way) but this is a pretty silly example.
So they are valuable, so long as you don't value them with money.
Just about any teacher that survives to an old age will beat me earnings wise with their pension, which they don't have to fund. I have to fund my own 401K or IRA, as well as pay into the teacher's pension fund with my property taxes.