The median pay across the whole US for software engineers is quite a bit higher then the median income for all professions. Or are you referring to a different country?
Doctors have an extra 4 years of very expensive school plus an extra 3-7 years of training. Lawyers have an extra 3 years of very expensive school and only make about 15% more on average than software developers. Accountants make on average about 30% less than software developers.