Immigration: There has to be a smarter, more humane way.

The sun sets above the U.S.-Mexico border wall, seen in Yuma, Ariz., Wednesday, June 9, 2021. The Biden administration says it has identified more than 3,900 children separated from their parents at the U.S.-Mexico border under former President Donald Trump's "zero-tolerance" policy on illegal crossings. The Border Patrol's Yuma sector recorded the highest number of separations of the agency's nine sectors on the Mexican border. (AP Photo/Eugene Garcia)

Santa struggled this holiday season: He was short of elves.

Our ports didn’t have enough workers to unload the ships that were stuck offshore full of gifts. Trucking companies couldn’t find enough drivers to deliver the goods. Stores needed shelf-stockers. Restaurants couldn’t hire enough cooks.

And yet, to our south, thousands of people clamored to get into the country to do jobs like these.

Our response, year after year? We spend millions of dollars trying to keep them out.

And it isn’t easy. The border patrol, it seems, can’t find enough people, either.

It all seems surreal. But our dynamic, free-market economy has dealt with labor shortages before. It has a solution, although it isn’t pretty. We call it “illegal immigration.”

No one likes illegal immigration. We wring our hands over our failure to stop it. And then we cheerfully hire millions of illegal immigrants to cut our grass, clean hotels, cook food, stock shelves, work in chicken-processing plants and do other low-paying jobs most Americans don’t want.

We think of this as a 21st-century crisis. In fact, our country has been trying and failing to deal with this kind of problem for nearly two centuries.

Opinion: Connecting dots, from immigrants to moneyed conservatives

Commentary: Civic responsibility amid mounting political violence

And: 'Great replacement' fears reek of racism

Back in the 1840s, it was Irish immigrants who did the unpleasant jobs and were unwelcome. We went on to pass laws aimed at keeping out Italians, Germans, Poles, Chinese, Japanese, Pacific Islanders, Mexicans and Jews. First came 19th Century laws aimed at banning almost all Asians. One law specifically banned Chinese women. A 1917 law imposed literacy tests.

Supporters of these laws didn’t hide their goal: to protect ethnic purity. Today, many of us count these immigrants of supposedly low ethnic “standards” among our treasured ancestors.

And with demand for labor exceeding population growth, our robust economy finds itself needing immigrant labor again.

There are plenty of proposals for bringing in labor in legal, humane ways. But as in 1854, anti-immigrant feeling is widespread. So we do nothing and live with an underground, black-market labor system.One could argue that this ugly system gets the job done, more or less. But is it the best we can do?

It is a survival-of-the-fittest arrangement. People in Central America save money from meager incomes to finance their trips, sometimes paying criminal gangs to help them. They face abuse and even death on their trips. If they don’t get in or are deported, they often try again and again. Then they live on society’s fringes, doing jobs Americans don’t want, to send money to relatives back home. They attend church. And they have been shown to commit fewer violent crimes than American citizens — perhaps because they are too busy working.

It is true that immigration can be disruptive. Immigrants from Europe and Asia were disruptive, too. They speak foreign languages and bring different foods, music and cultures. They have always been accused of taking jobs from Americans — even during labor shortages like today’s.

But our country suffers when a part of our economy is based on skirting the law and maintaining an underclass of fearful people.

We need to find a legal way to admit the resourceful, hard-working people our labor force needs. We ought to pay them fair wages, allow them better living conditions and let them stop hiding.

E.S. Browning is a retired newspaper reporter. Kevin Wagner's Civics Project column, normally in this spot, is on vacation and will return next week.

This article originally appeared on Palm Beach Post: Commentary: We need immigrants, so why do we treat them so hatefully?