Congressional Dems are butting heads with President Trump over his demand for ­$5 billion to continue building a wall along the southern border. Likely incoming House Speaker Nancy Pelosi vows she won’t spend one dollar for a wall and calls the idea “immoral.”

Not building the wall is what’s truly immoral. Allowing poor migrants to flood across the southern border forces taxpayers to toil longer and pay more taxes to feed and house them, accommodate their children in public schools and pay for their medical care.

Americans are already maxed out caring for our own needy, including the homeless sprawled on city streets. This nation has some 40 million people in poverty, one out of every eight people and one of every six children. That’s far higher than the share of people living in poverty in Canada or the UK.

Our country doesn’t need to import more poverty.

For the same reason, Trump is proposing that only legal immigrants who can support themselves without government handouts be granted green cards.

Mayor Bill de Blasio blasted Trump’s proposal as “un-American.” Gov. Andrew Cuomo said “the plan is ugly, it is cruel.”

Really? Why should Americans be compelled to provide a safety net for throngs pressing to get into the country?

Milton Friedman warned two decades ago that America can have open borders or a generous welfare system but not both. Open borders boost a growing economy by providing a source of labor. But that works only so long as immigrants are barred from government benefits.

Trump is tightening regulations under a longstanding law, on the books since 1882, that bars immigrants likely to need government benefits from obtaining permanent status. Starting with President Bill Clinton, the law has been applied so laxly that almost no one is denied a green card for that reason.

A staggering 63 percent of households headed by a noncitizen depend on Medicaid, food stamps, housing assistance or in some cases all of these taxpayer-funded programs, according to a December 2018 analysis of census data by the restrictionist Center for Immigration Studies.

That figure is almost double what it is for households headed by American-born citizens.

Right now, newly arrived legal immigrants who earn little or nothing are eligible for fully subsidized ObamaCare plans, with taxpayers footing the entire bill, even for copays and deductibles.

And 6.8 million children of immigrants are enrolled in Medicaid, according to the Urban Institute. Meanwhile, millions of American-born taxpayers who fund this giveaway to newcomers are going without insurance themselves, because they can’t afford it.

That doesn’t jibe with the ideal that a democracy’s first duty is to protect its own citizens.

Don’t expect the American public to buy into open borders and handouts for all comers. All Americans have to do is look across the Atlantic to see the disastrous results of that policy.

Hungary and Spain have put up tall barbed-wire fencing to bar migrants from Africa and the Middle East. The British are erecting a high, unclimbable concrete wall in the seacoast town of Calais, France, to prevent migrants from jumping aboard ferries and trucks heading into the Channel tunnel.

European voters have decided border walls are not immoral. They’re essential.

Europeans are also fed up with German Chancellor Angela Merkel’s self-righteousness. In the summer of 2015, Merkel welcomed more than a million migrants and told the public to just deal. Now the public is in revolt and shifting politics hard to the right across the continent.

This week, the UN announced a Global Compact for Safe, Orderly and Regular Migration. It’s a stealthy way of forcing countries to accept more migrants than their own citizens want or think they can afford. The US and at least 10 other major nations wisely refused to sign on. Expect more countries to do the same.

The international elites don’t get it, but everyday people have the common sense to know you care for the poor in your own country first.

Betsy McCaughey is a former lieutenant governor of New York.