Just because Donald Trump isn’t qualified to be president — and just because much of his agenda is hateful and undesirable — doesn’t mean that everything he says is automatically wrong. Some of his ideas deserve consideration and enactment. One of these is building a wall across our southern border with Mexico.

It has been ridiculed as a monstrosity and a colossal waste of money. The theory of the wall is that it keeps out low-wage workers and, thereby, raises the wages of U.S. workers, including earlier Hispanic arrivals. They are most vulnerable to additional Hispanic workers, because their skills generally overlap.

Just what a wall would cost is unknown. Guesses vary. Trump has said $8 billion. A detailed report by AllianceBernstein, a research firm, estimated between $15 billion and $25 billion. These sums seem (and are) large, but within a $4 trillion federal budget, they’re modest.

The crucial question is: If we had a wall, what would we get for it? The answer: A wall probably represents our best chance of reaching broad agreement on immigration policy, a subject that has frustrated Congress and the two most recent presidents.

Let’s be clear on one issue: Trump’s insistence that Mexico pay for the wall is absurd. No self-respecting Mexican president would accept it. If one did, the wall would become a subject of endless bickering between the two countries as to who actually owned and controlled it. The fact that Trump made this so central to his proposal suggests that he’s simply grandstanding.

Republican presidential nominee Donald Trump described his proposed wall along the Southern U.S. border during an immigration policy speech Wednesday. (Victoria Walker/The Washington Post)

Still, in the hands of someone serious, a wall could be a catalyst for a comprehensive overhaul of U.S. immigration policy. “It’s hard to understand opposition [to a wall],” as my colleague Charles Krauthammer recently noted. “It’s the most venerable and reliable way to keep people out.” He argued correctly that the outlines of a deal have long been apparent. It would:

● Change legal immigration criteria to favor employability (a.k.a. skills) over family connections. The emphasis would be on stimulating the nation’s economic growth.

● Require most businesses to belong to E-Verify, the government system that allows employers to check on the immigrant status of potential workers.

● Create a path to legality — and ultimately to citizenship — for the estimated 11 million undocumented immigrants in the country.

● Embrace policies — including a wall — that would credibly and dramatically reduce illegal immigration.

Without a wall, it’s doubtful that Republicans would enter meaningful negotiations on immigration policy — and without Republican participation, the stalemate would continue. In a recent Pew Research Center poll, 63 percent of Republicans and Republican-leaning voters supported a wall and only 34 percent opposed it. The distrust is deep. Republicans think Democrats don’t truly care about stopping illegal immigration; they mainly want “amnesty” for existing undocumented immigrants. In the same Pew poll, 84 percent of Democrats and those who lean Democrat opposed a wall.

There are two standard objections to a wall — both true but politically irrelevant. The first is that it might have once been justified but isn’t now because the inflow of undocumented Mexican immigrants is slowing and maybe reversing. Mexico’s birthrate — which affects its labor force — has declined, and its economy has improved. It can more easily absorb new workers. A 2015 Pew study found that the number of undocumented Mexicans in the United States had dropped by 140,000 between 2009 and 2014.

But this is a net figure: people entering minus people leaving. There are still hundreds of thousands of Mexicans and Latinos trying to cross the southern border illegally every year. A wall would make this harder and reinforce the natural trend. Some people wouldn’t try to enter; of those who did, fewer would make it. Tragedies — dying in the desert, being exploited by “coyotes” — would decline.

The second objection is that the southern border isn’t the only way people become illegal immigrants. Many arrive legally and overstay their visas. Indeed, according to a study in the Journal on Migration and Human Security, these immigrants now outnumber those breaching the southern border. But if E-Verify were widely adopted, these immigrants would have a harder time getting work.

If we could buy an immigration bargain for $25 billion, or even a bit more, it would be a fabulous deal. That’s the opportunity facing the next president. But we won’t make it any easier by stigmatizing the one change — a wall — that could be the foundation for compromise.

Read more from Robert Samuelson’s archive.