Society doesn't "decide". It's a decided by the labor market. Nobody wants to pay programmers six figures.
It's a myth that we think teachers are less important than programmers because they make less on average. There is just a larger supply of qualified teachers willing to work at lower prices.
Wait until you find out how little art history masters holders make. Amount of training is irrelevant to how much money you get.