The pay issue is state specific. In my state, I know a secondary Ed biology teacher making about as much as I do as a software dev. Both about 10 years experience and a masters degree. My state is in the top 10 for teacher pay though.
[1] https://www.niche.com/k12/berry-hill-elementary-school-syoss...