IT WAS a technical and splintered ruling, but — at least for now — a joyous one. The Supreme Court on Thursday preserved the Deferred Action for Childhood Arrivals program, better known as DACA. The more than 700,000 “dreamers” whom the program protects — men and women brought to the United States as children, who have done nothing wrong, who grew up as Americans and contribute to the only country they know as home — are safe from immediate deportation. This is good news for them, and good news for the country.

But they are still not safe from President Trump’s arbitrary whims and the malice of the anti-immigration fanatics he has brought into government.

“The dispute before the Court is not whether DHS may rescind DACA,” Chief Justice John G. Roberts Jr. wrote for the court. “The dispute is instead primarily about the procedure the agency followed in doing so.” Chief Justice Roberts found that the Trump Department of Homeland Security cut corners when it tried in 2017 to end the program, which provides dreamers protection from deportation and allows them to work legally. Without sufficient justification, the rescission was illegal. This is another case in which the chief justice joined the court’s four liberals to produce a ruling that defied the expectations of cynics who argue that judges rule merely for the benefit of the policies or parties they prefer.

Even so, Congress must not be lulled into a sense that the dreamers can now relax. The court’s words should be taken as a warning: These Americans remain vulnerable. Mr. Trump occasionally expresses sympathy for the dreamers, but what matters is not what he says but what he does — which is everything in his power to run them out of the country. Fortunately, his incompetence thus far has matched his malice. But his administration could quickly issue a new memorandum with more careful reasoning that the court would presumably uphold.

And what a shame and a waste that would be. The dreamers are Americans in all ways that should matter. Now in their 20s and 30s, they willingly broke no law when their parents brought them to the United States. They grew up here, went to school here and now, for the most part, honorably work here. To be eligible for DACA, they had to be studying, have graduated from high school or have been serving in or honorably discharged from the military.

Some 27,000 dreamers work in health care — doctors, nurses, EMTs, physician assistants. Even as they scrambled to protect people from covid-19, they had to worry that the Trump administration would soon target them for deportation to countries where they would be, effectively, total foreigners. Thousands more are college students, teachers, food preparers and government workers. Deporting these people would be an act of economic and social self-harm that, studies suggest, could cost the country hundreds of billions of dollars.

Congress should finally step in to prevent Mr. Trump from inflicting such damage on the nation. Republican lawmakers have for many years claimed to care about the dreamers, but Congress has habitually failed to act. They should need no extra enticement — border funding, for example — to do something they say they know is right.

Americans, meanwhile, should remember the dreamers when they vote in November. Another Trump term and the reelection of lawmakers who have shown no determination to act may well doom them. This would be an act of counterproductive cruelty that voters have in their power to prevent.

Read more: