The Supreme Court's decision Thursday that the Trump administration botched how it sought to end the Deferred Action for Childhood Arrivals program was a gift to President Donald Trump's re-election campaign.


And he's turning it down.


Imagine him shouting "once more unto the breach, dear friends," in his best King Henry V voice.


Silly man.


The president's move to rescind DACA followed a Trump administration pattern. It decides it wants to do something, then does it without following long-established rules under the Administrative Procedure Act that require the government to document its reasons for regulations – when making them and when rescinding them.


That's why the administration has an awful record defending its actions against court challenges – which is a good thing, especially given the sledgehammer Trump has been using to shatter the environmental regulatory system.


In DACA, Trump officials decided that President Barack Obama couldn't legally have done what he did, so they undid it. Chief Justice John G. Roberts Jr., who wrote the 5-4 decision, noted that the administration had the authority to end the program the previous administration had begun.


"The dispute before the Court is not whether DHS may rescind DACA. All parties agree that it may," Roberts wrote. "The dispute is instead primarily about the procedure the agency followed in doing so."


So it's not what Trump did but the way he did it. The court, though, didn't "punt," as Trump claims, it flagged him for illegal procedure.


And the rest of his tweet about the Democrats not negotiating is self-serving gibberish. In fact, Trump had agreed to a bipartisan deal that included some funding for his cockamamie wall, but under pressure from the hard-liners he moved the goalposts and the deal died.


Since then, the Democrats understandably haven't bothered to negotiate with Trump over the issue.


But here's the thing: DACA enjoys significant popularity across the political spectrum, with the notable exception of the immigration hard-liners within Trump's inner circle and electoral base.


Developed by Obama after Congress failed to address the one-off circumstances of the "Dreamers" – people living here illegally after arriving as children – DACA protected some 700,000 people from deportation so long as they met certain criteria (basically, that they were living lawful, productive lives).


These folks have by and large been raised as Americans, educated at taxpayer expense, added to the economy and, in many cases, started families with U.S. citizen children as dependents.


Tough, say the Trumpsters, send them back where they came from, even though as children the Dreamers weren't making the decision to live in the U.S. without legal status.


The vast majority of Americans are sympathetic to the difficult situation in which the Dreamers find themselves – no legal status in what has become their home country – and believe they should be offered a path to citizenship, or at least legal status.


With the Supreme Court voiding Trump's rescission of DACA and sending the case back to the lower courts, it gave Trump some room for political maneuvering.


The smart play for Trump would have been to say that he disagrees with the decision and his administration will review how to address the issues the court objected to, and then let the issue go dormant until after the election. The hard-liners know where his heart is on the issue, and he can blame the courts – a favorite punching bag even though he's stacking them with conservatives – for thwarting him.


But by fanning the issue, Trump reminds people just how heartless he can be.


– Scott Martelle, a veteran journalist and author of six history books, is a member of the Los Angeles Times editorial board.