A tide of anti-immigrant sentiment has produced the nation's harshest crackdown on undocumented residents.

While the courts have blocked some of Alabama's draconian law, it still stands as a distressing example of the growing national anger at vulnerable people whose main offense is wanting to pursue better lives in this country.

Among other things, Alabama's law makes criminals of anyone who would "harbor" or "transport" an illegal immigrant. Parents will have to start asking a child's Hispanic playmate to show them his papers before allowing him sleep over. Likewise for any landlord renting to someone with a foreign accent.

Enforcement of such extreme measures, which clearly contradict federal law, was temporarily blocked by U.S. District Judge Sharon Blackburn. But other harsh steps got her blessing. State and local police now have huge discretion to check for immigration papers and detain a person on only an undefined "reasonable suspicion" of illegal status.

Alabama's law has done what its supporters wanted: create a climate of fear that drives away illegal immigrants, no matter how responsible they are. There have been reports that pregnant women are afraid to seek medical care. Families are pulling their children from schools, which are now required to ask students whether they're here illegally.

A number of other states are also cracking down on illegal immigrants. Angry political movements tend to rise in times of national stress or profound change, and in these tough times, illegal immigrants are once again a convenient target. Today's climate is so bad that even a tea-party darling like Texas Gov. Rick Perry got booed for saying immigrant children deserve a chance at higher education, even if their parents came here illegally.

Ironically, the current anti-immigrant fervor comes at a time when federal enforcement of immigration laws has actually gotten tougher. Deportations have reached record levels (almost 393,000 last fiscal year), while the number trying to enter illegally appears to be dropping.

The nation's immigration system too often seems to fail to recognize the reality that drives so much of the illegal entry into the United States. Many of those escaping from poor countries sneak in because they know there is hard, low-paying work to be done here that too few Americans are willing to do. An improved guest-worker program is a better way to fill that economic void.

Those illegal immigrants who have been in this country a long time and lived otherwise law-abiding lives should be given a path to citizenship. America is still a magnet for those who want better lives, and Americans should be proud of that. The ability to attract ambitious, hardworking immigrants can be a source of national strength, if the nation can resist knee-jerk measures and establish a reasonable mix of enforcement and opportunity.