The Pentagon said the money it was ceding would have gone to fighter jets, combat aircraft, ships and National Guard equipment. Instead, it will be used to put up 30-foot-high barriers along six sections of the border so Mr. Trump can boast that he is fulfilling his campaign promise, despite Congress’s repeated refusal to give him all the money he wants and lower court rulings that barred his use of other funds for the wall. Mr. Trump managed this in part by declaring a state of emergency a year ago to divert military funds, and in part thanks to a Supreme Court ruling that set aside lower court injunctions that prevented Mr. Trump from commandeering Pentagon cash to pay for the wall.

It has become almost tedious to recite the reasons this wall is a waste of money, starting with the fact that it was initially conjured up by Mr. Trump’s campaign advisers, back when he was exploring a run for the White House, not as a solution to illegal border crossing but as a talking point to make sure that their man, famously resistant to reading from a script, would remember to talk about getting tough on immigration.

Once Mr. Trump was elected, the talking point that became his signature campaign promise then became the signature obsession of his presidency. The battle over its funding with a skeptical Congress led at one point to a partial government shutdown and the declaration of a state of emergency. “Build the Wall” became a mantra at Mr. Trump’s rowdy rallies, the motto of meanspirited and often cruel efforts to close America’s doors to immigrants, especially Muslims or immigrants of color, legal or illegal.

The onslaught against America’s openness to immigrants has taken many shapes, from the separation of children from their parents, to the shutting down of various preferential visa programs, to the bans on travelers from some predominantly Muslim countries. The administration has won temporary approval from the Supreme Court to deny green cards to immigrants thought likely to tap public assistance programs, the so-called public charge rule. It has also barred New Yorkers from applying for trusted-traveler programs as punishment for a state law limiting immigration agents’ access to state driver’s license information.

But the expensive and useless wall has remained the centerpiece of Mr. Trump’s spiteful vision. From the outset, the project has been riddled with lies and illusions. Mr. Trump has argued that the wall would block illegal migrants, though as many as half of the undocumented immigrants in the United States entered legally and overstayed their visas. He claims that the southern border is a “pipeline for vast quantities of illegal drugs,” though according to the Drug Enforcement Administration most trafficking occurs through ports of entry — or, in the case of the powerful opioid fentanyl, through the mail.