"The deeper question is: why do we systematically undervalue the very fields that contribute the most to society?"
The answer for most of them is simple: oversupply. Being a teacher is generally something a lot of people want to be, and especially for K-12, almost by definition, the intellectual bar is "finished K-12 reasonably well". (If you read curricula for teaching schools, you'll find that while teachers are generally educated maybe a year or two's worth past the high school level in their chosen teaching subjects, that's generally it for the requirements.) Accomplishing the "bullet point" objectives of being a teacher is not a difficult enough bar to filter out enough people.
(I phrase it that way to forstall hiking the goalpost to the sort of astonishing, life changing teacher whose slightest jiggling of their eyebrows inspire students to new heights of knowledge and curiousity. Those may not be all that common, but that's not the bar in question. Most teachers are pretty close to average.)
When you imagine yourself in the role of teacher (the inspiring kind, I'm sure) or researcher (who is, of course, hot on the trail of the cure of cancer, not researching some workaday research question), it's easy to imagine how you should be paid more. But if you put yourself in the position of paying for these things with your money, and you offer $100,000/yr to be an elementary school teacher in some medium-sized town in the country because wouldn't that just be awesome, and you get your first 10,000 applications today with another 10,000 coming tomorrow, it's not long before you start thinking "Hmmm.... maybe I don't have to part with quite $100,000/yr to fill this position.... maybe $90,000 isn't such a bad idea, and I can use that $10,000 to do some other $WORTHY_THING..." (Or... maybe I could use this money to hire two teachers....)
It's easy to imagine how someone else should pay teachers three or four times more... it would be a lot more challenging if you were the one doing it.