The immigration debate in Congress is dead for now, but in all the heated discussion, many flaws in the legislation were never discussed.

The immigration reform debate completely ignored one big magnet for illegal entry into the United States: minimum-wage laws. And as the minimum wage increases that were recently passed this year go into effect, this problem will get worse.

Even employers willing to illegally pay subminimum wages are reluctant to hire U.S. citizens or legal residents, because even workers who’ve knowingly agreed to the low pay have a legal right to sue. And, by law, you can sue to get back double the underpayment of wages.

So, if a worker gets $5 per hour when the minimum is $7.25, he’d have about $4,500 in underpayments for a year — and a $9,000 payoff for suing.

As a result, only a tiny fraction of 1 percent of Americans covered by the minimum wage are paid too little, and these rare violations mainly involve mistakes by employers, not outright lawbreaking.

The only "cops" needed are just 700 or so federal agents who are also responsible for enforcing overtime pay, recordkeeping, child-labor standards and other regulations.

This is why illegal aliens make up the overwhelming majority of subminimum wage workers: Not only are they more willing to work for less, but they’re afraid to sue, for fear of being exposed and deported.

A recent survey estimate by the Pew Hispanic Center as well as an older estimate by Barry Chiswick at the University of Illinois at Chicago imply that over 15 percent of illegal alien workers earn less than the minimum wage. With something over 7 million illegals working in the United States, that easily means that more than a million are subminimum workers.

A one-time amnesty won’t make this illegal-alien problem go away. Without some change in enforcing the minimum-wage laws, there will still be a demand for new illegal aliens, because they are the only people firms can trust not to squeal to authorities.

Amnesty won’t be without its disappointments for illegal aliens who are already in the country and eligible for the new "Z" visa. Even the mere prospect of an amnesty being approved will provoke many employers to shed their illegal workers. Why? If illegal aliens are eventually legalized, there is nothing to stop them from suing the firms for past underpayments.

With those current million minimum-wage violators no longer able to violate the law simply because they might get a "Z" visa, a million-plus spaces may open up for new illegals. The problem may only get worse as the new increases in minimum wages make it even more attractive for marginal firms to hire illegals.

Short of giving new illegals the right to sue without facing deportation, any serious effort to end the subminimum-wage demand for illegal aliens would probably have to use undercover agents posing as illegals — and require dramatically more agents (increasing the penalties for violating the minimum-wage laws would also help.)

Despite all the assurances, few believed that the illegal-immigration bill considered by the Senate would have stemmed the steady flow of new illegal aliens. But the situation is even worse than that: The legislation would have actually encouraged more illegal immigrants to enter the U.S. at the same time it makes it difficult for many existing illegal aliens to keep their jobs.

John Lott, a former chief economist at the United States Sentencing Commission, is the author of Freedomnomics.