This kind of income disparity is completely unfair, and we haven't seen such high income and wealth disparity in the USA since the 1920s.
[1] https://www.theguardian.com/technology/2017/sep/26/facebook-...
The income disparity is just a product of that reality.
Outside of Silicon Valley, engineers don't get paid that much; the really high-income people are various executives, managers, finance people, business owners, etc. Engineers do pretty well for paid grunts, but compared to the ownership and executive classes, it's not that great.
Obviously in a capitalist society it makes perfect sense to pay your staff the minimum possible while still retaining them. But it doesn't make it a fair system. Just because I had the privilege of being born into a good family with a good head on my shoulders doesn't mean that I deserve to get paid between 5 and 8 times more than the janitor (the income disparity between a janitor on $15 and a software engineer making 6 figures).
In Australia I make roughly double what the cleaners make. I think that's a much more equitable number.
SW engineers are paid more than other engineers in the US because there just isn't that much work, or demand, for other engineering disciplines here. A lot of the work has gone offshore: as an engineer with a EE degree, I don't do EE work because there just isn't that much of it here. All the electronics work has gone to Asia, except in the defense sector. What the US is still really good at is software: look at all our highest-valued tech companies, and all the other companies in Silicon Valley: an overwhelming number of them are doing software work. Smartphones, all the apps running on them, etc., are all software, and are a huge part of the economy now. Not to mention all the other places software is now used, such as finance, where it's used by non-tech companies to enhance their business. If it weren't for software, the US economy probably would have collapsed some time ago.
Therefore, with software being a driving force in the US economy, and a shortage of qualified talent compared to demand (plus a lot of workers that are incompetent...), wages have been driven up compared to other engineers.
Finally, if you look at real engineering wages compared to the past, inflation-adjusted, engineers were paid more back in the 60s or 70s or so, and had more job security too. So it's become a less attractive career than it was in the past, so software engineering is really just a holdout.
As for Europe, AFAICT, engineers are just horribly underpaid there, and they try to make up for it some with extra perks like job security.