Immigrants are brought into the US to fill existing positions under poorer conditions than US workers, and to generally boost aggregate GDP (mostly to the benefit of capital/land owners).
Canada and Australia have extremely generous immigration systems, but are backwaters for software development compared to the USA, and IT salaries are worse.
Additionally, there is no diversity or equality in the US H1B intake: Indians make up 75% of the intake, and 78% of them are male:
https://www.uscis.gov/sites/default/files/document/data/h-1b...
The H1B visa could be hugely improved if the intake was limited to 10% max from any one country and max 49% male from any one country. The US Diversity Lottery has per-country intake limits already.