As an H-1B worker in Palo Alto (who also had to struggle through the ridiculous immigration process for almost two years), I'm being treated extremely well by my employer. They went out of their way to get me through the long-winded and expensive H-1B application process. I get compensated well, and I'm treated as any other valued employee.
While I recognize that a lot of ambitious and driven engineers from abroad have a similar experience to mine in the Bay Area, I'm also not blind to the fact that our situation is simply not representative of the typical H-1B worker.
The incentive structures surrounding the immigration process are not set up to effectively prevent abuse and exploitation of cheap labor. "Importing" desperate and often undereducated workers is cost-effective enough to happen at a fairly uncomfortable scale, to the detriment of the workers themselves and the industry as a whole.
Immigration is obviously complex for a whole host of reasons, and there's a lot of countries that struggle with (or outright abuse) that process. Of course, H-1B engineers in the U.S. are nowhere near as mistreated as migrant workers in many other nations — including wealthy ones — but it's still a commonly exploited system here. Those of us who have a relatively dignified experience in this mess are not near the middle of the curve.
I'm not familiar enough to know which nations get it "right", if any, but there certainly are lessons to be learned by looking elsewhere.