Part of what determines pay is
1. how difficult is it to find qualified people
2. does the position help you make more money, or is it an expense
Software developers help companies make more money. It is the Add in Value-Add. They are the equivalent of the machines in a machine shop. Without them, what is the point in being in business. If you are a software company you pay what you need to pay, to recruit and retain the best developers you can.
Teachers work for a government agency. It won't turn a profit. The agency collect tax dollars for existing and teachers are an expense. There really isn't any competition to recruit the best ones. People pay lip service to the idea of recruiting the best ones, but they really don't. Education wise, it compares to nurses and architects. Benefit wise, it is one of the best in the country. Some parts of the country have trouble recruiting new teachers. But others don't . A school district will never pay more than required to have a teacher in the classroom, talent be damned. In fact, I think school districts would rather hire fresh young faces out of college, and pay them starting wages than experienced master teachers who will cost them 2x-3x as much.