I take a bit more cynical view than that. They did it because they could. Both technology and law made it an irresistible business strategy and I would too if it meant meeting my fiduciary duties to maximize the profits of shareholders and business owners. Business is not in business to make jobs, it isn't even to make a product or render a service, business is not social service. Business is in business to make money. Business is amoral, the only restrictions they must hold legal restrictions. If I can legally have a widget manufactured for 50 cents in Mexico and it costs 50 dollars to produce in the United States due to unions, regulations or any other reason then I would be failing my ethical duty to the business I managed to pay the 50 bucks. It boggles my mind that that core conservative value is even questioned on this forum.
And therein lies the problem. The owners of businesses didn't used to think that way. They had some consideration for their employees...realizing that they were also, most likely, their customers. Sure, there have always been some greedy, ruthless people in the business world...and they were properly vilified (think Mr. Potter).
But, in consideration of the fact that we are dealing with some seriously immoral people, who would seize upon the benefits of this country (safety, standard of living, etc.) while kicking aside their fellow citizens, I think that we should seriously consider the last part of your sentence...legal restrictions. When individuals or businesses fail to live by some sort of moral code...laws must be written to punish offenders. Sweatshop and child labor laws were enacted when there was a public outcry. I say it's time for another round of slapping down the greedy opportunists who do not give a rip about this country...except for what they can gain personally. But wait, we already have these laws regarding hiring illegal labor....they just aren't enforced.
Most businesses are run by honest people, who are trying to make a living, while providing a good future for their children...as well as opportunities for their employees. Why are we allowing these companies to be pushed aside by their more unscrupulous (cheating) competitors? Nice that those who didn't play by the rules are being rewarded.