Companies were illegally hiring foreign (Indian in particular) professional to replace IT workers at a reduced salary. It's not to say that foreign IT workers are bad, but citizens come first. The procedures are clear: Show you are unable to find someone in the USA (you are supposed to show job postings and let a reasonable amount of time and show lack of qualifications of the applications) before you apply for a foreign worker visa.
You get the general intent of the H-1B program correct, but you miss the legal loophole that tech companies put in. It only requires companies to prove they're not displacing American workers OR pay H-1B holders $60,000. So replacing US workers IS LEGAL as long as you pay a minimum of $60,000.
"In 1998—during the tech bubble—lawmakers amended the law to provide more visas at the request of the growing tech industry. At the same time, legislators cracked down on outsourcing companies that were employing large numbers of H-1B workers from Asia, and then contracting them out to American companies looking to save money. Though these consultants are typically called “outsourcing firms,” in a sense their work related to the H-1B visa program is better described as “insourcing,” since what they’re doing is helping companies find workers abroad whom they bring here for new jobs.
Under the amended law, companies that rely heavily on H-1B workers (more than 15 percent of their workforce) would now face additional scrutiny when applying for visas. These companies would have to promise not only that their H-1B workers would not replace American employees at their own company, but that they wouldn’t be used as replacements at firms that the company had contracts with either.
The new requirement would have provided some additional security for American workers, but a seemingly small, yet significant exemption was also written into the law. It allows those same H-1B reliant companies to ignore the requirements about protecting American jobs as long as they pay the foreign workers at least $60,000 a year, or hire a foreign worker with a master’s degree. It’s unclear why this exemption was included, though critics of the H-1B program say tech companies lobbied for it to undermine the new, tougher restrictions that might impact their ability to hire foreign workers. Considering the average IT worker in the United States makes far more than $60,000, that exemption makes it lucrative—and legal—for companies to displace American workers with cheaper H-1B workers. And it effectively undoes the additional protections of the 1998 bill."