This argument doesn't hold because you don't know how much an average American SWE would be making today if there were no H1Bs — it could be $200k.
> because there aren't enough qualified workers in the US
It's often not a shortage of skills but a shortage of pay.
Companies can also invest in growing local talent. There are tons of STEM graduates who cannot find jobs — because why hire a junior when there's a supply of Indian H-1B labor from shady consultancies, who won't complain or negotiate due to the constant threat of deportation?
What needs to be done is to end the exploitative aspect of H1B visas. Recipients should have a direct, unconditional pathway to residency, independent of their employer's goodwill. It shouldn't be a modern slavery.
Also, stop immigration fraud to prevent these visas from being used solely for cost-cutting and replacing local labor. Raise the minimum wage for H1B, introduce additional taxes — or just auction visas off, granting them to the highest bidder. So only the top talent would get them.