A crucial part of President Donald Trump's rationale for building a wall along the United State's border with Mexico is that it would help to stop the trade of illegal drugs, including marijuana.

"I want to build the wall. We need the wall," Trump said at one of the presidential debates last year. "We stop the drugs. We shore up the border."

There's other reasons for building the wall, of course. It would help to staunch what Trump sees as a flood of illegal, migrant workers from Mexico and would serve a symbol of the Trump administration's protectionist, America-first policies on trade—the physical embodiment of Trump's efforts to undo NAFTA. Beyond that, it would be a big, expensive building project and Trump likes big, expensive building projects.

Still, the idea of stopping the flow of illegal drugs from Mexico remains central to the border wall's function. Kellyanne Conway, Trump's White House counsel, said as much last week in an interview with CBS.

Mexico doesn't want to pay for the well, Conway told CBS News' Gayle King, "because they want to continue to allow people and I assume drugs, since they're not doing much to stop that, pouring over our borders."

If the Trump administration wants to stop the flow of drugs over the border, though, building a wall might not be the most effective policy, says David Bienenstock, the head of content at High Times and a reporter with 15 years of experience covering marijuana markets and the federal government's war on those markets.

Instead of increasingly militant and expensive measures designed to stop the flow of drugs, Bienenstock told Reason in an email interview this week, Trump should be backing the legalization of marijuana, which has already begun to cut into the drug cartels' profits while creating American jobs.

"It's important to understand that the Drug War created the cartels, not the other way around," says Bienenstock. "We've been wasting trillions of dollars for nearly 50 years on wholly ineffective, and even counterproductive, efforts to stop the flow of drugs into the United States, and those efforts have only made the cartels bigger, stronger, and more dangerous."

Even by the wasteful standards of the War on Drugs, Trump's wall looks like a boondoggle. Reason's Shikha Dalmia did the math on The Wall this week, and the numbers are sobering.

"Just a single-layer fence—not a wall—on the 1,300 miles of the open Southern border will cost upwards of $6 billion—assuming, as per a CBO study, pedestrian fencing costs of $6.5 million per mile and vehicle fencing costs of $1.7 million per mile," she wrote. "A single Border Patrol agent costs about $171,400 annually. So tripling that force would add up to a whopping $7 billion or so more a year, according to the CBO. Annual maintenance costs would be hundreds of millions of dollars. In short, the total hit if cost projections don't balloon—a big if, assuming that Trump won't use illegal Mexican workers and will use only American steel—would be somewhere close to $15 billion upfront."

Trump says Mexico is going to pay for the wall, but slapping higher taxes on imports will force American consumers to bear most of the cost. And for what? If Trump actually builds the wall, the cartels will only build more and better tunnels, as the New York Times reported in September, citing Border Patrol agents who have worked to find and destroy drug tunnels for years. Trump says the wall will include technology to detect tunnels, but that technology doesn't exist yet and would only add to the project's price tag. Securing the full length of the 1,900-mile southern border is virtually impossible.

"No amount of enforcement, even military-level, can remove the financial incentive of the black market," says Bienenstock, the author of How To Smoke Pot (Properly): A Highbrow Guide to Getting High. "In fact, every increase in enforcement only makes the black market more lucrative, and the fight to control this illicit trade more deadly and destructive."

The less expensive, more effective way to reduce the flow of drugs over the border is loosen drug laws here in America. In fact, liberalized marijuana laws in some states are already having an effect. The Washington Post reported in March that "marijuana seizures along the southwest border tumbled to their lowest level in at least a decade."

"Agents snagged roughly 1.5 million pounds of marijuana at the border, down from a peak of nearly 4 million pounds in 2009," the Post reported. "The DEA has even found evidence that the flow of illegal marijuana is starting to reverse, with some cases of U.S. marijuana being smuggled into Mexico."

In December 2014, NPR News spoke to a marijuana grower in Mexico who described a similar economic phenomenon created by the legalization of marijuana in some parts of the United States. "Two or three years ago, a kilogram of marijuana was worth $60 to $90," the grower told NPR. "Now they're paying us $30 to $40 a kilo. It's a big difference. If the U.S. continues to legalize pot, they'll run us into the ground."

Trump knows this, even if he doesn't say so anymore.

In April 1990, during a luncheon hosted by the Miami Herald, Trump described U.S. drug policy as "a joke" and said there was only one sure way to win the War on Drugs.

"You have to legalize drugs to win that war," Trump said. "You have to take the profit away from these drug czars."

Trump should listen to his own advice and look to legalize marijuana at the federal level, instead of spending political capital and lots of cash on a border wall that will deserve its place in the War on Drugs hall of shame.