On Monday, U.S. Sen. Charles Grassley warned President Trump to halt his purge of senior officials at the Department of Homeland Security. The Iowa Republican told the Washington Post that the president was removing “the intellectual basis” for what he “wants to accomplish in immigration,” or “pulling the rug out” from his own policy.

Donald Trump the candidate campaigned heavily on a promise to secure the border, portraying a crisis that did not exist. Of late, his administration has struggled to manage a surge of migrants at the U.S.-Mexico border. The president has declared a “national emergency” as a way to defy Congress and redirect funds to pay for portions of a border wall. He has threatened to close the border, though backing off as many pointed to the disruption and harm that would follow.

Over the weekend, the president turned on his team, Kirstjen Nielsen submitting her resignation as the secretary of homeland security on Sunday. A day later, the White House announced the coming exit of the Secret Service director, the move fanning speculation about others to follow.

All of the turmoil reinforced the impression that while the president blusters about border security, he lacks a coherent plan. The president said last week, “We may have to go a very tough way.” Yet Nielsen proved plenty tough — to the point of separating migrant children from their families and housing the children in what resembled cells. Her team did so without a system for tracking family members so they could be reunited.

Nielsen devised a plan for requiring asylum-seekers to wait in Mexico pending hearings in their cases. On Monday, a federal judge halted the practice. He ruled the approach failed to provide adequate protection for asylum-seekers. This has been the pattern, the president launching extreme, even cruel, steps and the courts concluding they run counter to the law.

Recall that the law concerning asylum-seekers dates to World War II, when the country did not respond with the necessary compassion to those fleeing Nazi Germany. The country made its own pledge of never again. So, according to the law, asylum-seekers must get a hearing. In this instance, they are the changing face of immigration, mothers and children in pursuit of refuge from the fear and violence of El Salvador, Guatemala and Honduras.

If there is a strong case for helping these countries and thus reducing the number looking to escape, the president has slashed such assistance. He cut off the remaining funds last month — just a day after Nielsen signed what the department described as a “historic” agreement of cooperation on border security with Central America.

That apparent about-face gets to the chaos in policymaking that many critics cite, the positions put forward and then abandoned, the time spent challenging or skirting the law. No doubt, the country’s immigration system is broken. Both Republicans and Democrats have issues they must face. The trouble is the president appears determined to widen the divide rather than seek the required compromise involving such things as strengthening border security, providing legal status for undocumented workers and dealing with the unintended consequences from immigration changes going back to the 1960s.

That is the leadership needed. Instead, the president plays the demagogue and diminishes the country’s standing. He also undermines the larger truth about the benefits of immigration. As Ezra Klein of Vox noted in an essay this week, the country’s population is growing more slowly than at any time since the Great Depression. Many cities and towns are shrinking, right, Akron? As North Hill reminds, immigration is a path to renewal and expansion, to something better as a result of new residents.