The opinions expressed by columnists are their own and do not necessarily represent the views of Townhall.com.

President Donald Trump's key immigration rule change, to discourage immigrants from relying on public health programs, food stamps, housing assistance and other welfare, got derailed on Friday by three federal judges. Their decisions, blocking Trump's rule from going into effect, are wins for Democrats and immigration lobbyists. America's poor are the losers. Our country needs to take care of its own needy first.

Trump's proposed rule would make it harder for immigrants who use welfare to qualify for green cards and permanent residence, and it would give preference to immigrants who fend for themselves. The rule would also require visa applicants to show they won't use welfare if they're let in the country. Manhattan federal Judge George Daniels blasted Trump's proposed rule as an "exclusion in search of a justification," implying it was a racist ploy to keep out foreigners.

Judge Daniels has his facts wrong. There are already over 300,000 families in New York languishing on Housing Authority waitlists and over 4 million people nationwide waiting for public housing or housing vouchers. Some suffer in squalor on the street. Welcoming more people into this country who can't keep a roof over their head without public assistance is insanity.

Public opinion is on the president's side, according to a Harvard/Harris poll. Sixty percent of voters agree that immigrants who are likely to rely heavily on welfare instead of supporting themselves should be denied permanent residence. That's what Trump's rule boils down to.

Judge Daniels mistakenly claims there's "absolutely no support in the history of U.S. immigration law" for it. Daniels needs a refresher course. In 1882, as immigration soared, Congress voted to exclude "any person unable to take care of himself or herself without becoming a public charge." That law is still on the books. In 1999, President Bill Clinton redefined "public charge" to include only those receiving cash welfare payments, not health care, food stamps or housing help -- a distinction without a difference, as these giveaways use taxpayers' cash.

Clinton's rule contradicts American values, not Trump's.

University of California President Janet Napolitano slammed Trump's rule for discouraging foreign students from using food stamps and housing assistance. Napolitano says the rule makes it harder for "the best and brightest" from other countries to study here. Shouldn't taxpayers' dollars be reserved for our own best and brightest?

National Academy of Sciences research shows that the average first-generation immigrant costs state and local government $1,600 per year, including public education and safety net programs, minus taxes paid. Newcomers who don't use safety net programs cost less, benefiting taxpayers. Yet New York Attorney General Letitia James took the lead challenging Trump's rule. It makes you wonder whom she's serving -- definitely not taxpayers.

Fortunately, Friday's decisions almost certainly will be reversed on appeal. Meanwhile, Trump has announced another immigration rule -- this one to correct an outrage that gives immigrants a better deal on health insurance than U.S. citizens get.

The Affordable Care Act allows legal newcomers to enroll in ObamaCare on arrival -- no waiting. If they're poor, they get a free ride, including Uncle Sam picking up their copays and deductibles. Even immigrants over age 65 get this deal -- an invitation to bring over ailing Grandma.

No such cushy deal for Americans. In 14 states, 2 million who don't qualify for Medicaid because they earn too much also don't qualify for ObamaCare because they earn too little. Because they're American, they're caught in the middle and get nothing -- no insurance. If they were immigrants, they could enroll in ObamaCare. The rules for immigrants are more lenient.

Here's another outrage: Some 2.5 million middle-class people dropped ObamaCare because they couldn't afford it. While they remain uninsured, their tax dollars are buying plans for noncitizens.

As global migration soars, nearly every developed country has adopted rules requiring immigrants to be self-sufficient. Denmark, Germany and Austria bar them from using welfare. Finland and Belgium require proof of employment.

But here, Democrats oppose any limits on immigration, tarring those who disagree as "racists." That name-calling divides the nation. We need a civil debate over how to welcome migrants to keep our economy growing yet still put our own needy first.

Betsy McCaughey is a former lieutenant governor of New York State. Contact her at betsy@betsymccaughey.com