One key reason Donald Trump’s presidency has been so damaging is that he has a way of corrupting all the people and institutions he comes in contact with, infecting them with his virus. No one remains untouched.

As the sudden firing of Navy Secretary Richard V. Spencer shows, that includes the military. Spencer’s story also bears a remarkable resemblance to the Ukraine scandal, in the way people with their own agendas played on Trump’s most repugnant impulses to manipulate him.

Spencer’s firing has its roots in the case of Edward Gallagher, a Navy SEAL who became a Fox News hero. Gallagher’s long and complicated case began when members of his own unit accused him of a series of war crimes, including firing on civilians and murdering a wounded teenage Islamic State fighter receiving medical treatment from his unit.

Gallagher allegedly stabbed the wounded fighter multiple times, then took a picture with his corpse and texted it to friends, with the caption “Got him with my hunting knife.” He was also charged with covering up his crime by threatening to kill members of his platoon if they reported it. They did anyway.

Gallagher’s trial was a chaotic mess marred by accusations of prosecutorial misconduct and a witness who abruptly changed his story on the stand. In the end, Gallagher was acquitted of murder but convicted of posing with the corpse, a violation of the laws of war.

Then Trump pardoned him, along with two other servicemembers who had also been accused of war crimes.

Those pardons generated enormous controversy both inside and outside the military, but they were not surprising. From the time he began running for president, Trump has shown nothing but contempt for ideas like military order and discipline, respect for human rights and standards of wartime conduct. He has advocated torturing detainees, suggested that a way to fight terrorism would be to murder the families of suspected terrorists and mused about committing genocide. Accused war criminals are his kind of people.

Which those advocating on their behalf understood — just as Rudolph W. Giuliani and his goons understood that the way to get Trump to fire the U.S. ambassador to Ukraine was to tell him that she wasn’t loyal to him.

While the details of the Gallagher case are complex, what we know is that after Trump’s pardon, the Navy began a formal review to determine if Gallagher should be stripped of his Trident pin, removing his status as a member of the SEALs. Trump then tweeted, “The Navy will NOT be taking away Warfighter and Navy Seal Eddie Gallagher’s Trident Pin,” effectively saying he didn’t care what the service’s procedures were or what its inquiry found, he was going to overrule them.

It appears Secretary Spencer was attempting to find some kind of compromise; according to the Pentagon, he suggested to the White House that if the president allowed the inquiry to go forward, he would permit Gallagher to retire with his status as a SEAL intact. This proposal then became the stated justification for Secretary of Defense Mark T. Esper to fire Spencer.

In a striking letter to the president, Spencer wrote that “The rule of law is what sets us apart from our adversaries,” then went on to say this:

Unfortunately it has become apparent that in this respect, I no longer share the same understanding with the Commander in Chief who appointed me, in regards to the key principle of good order and discipline. I cannot in good conscience obey an order that I believe violates the sacred oath I took in the presence of my family, my flag and my faith to support and defend the Constitution of the United States.

While Spencer is Trump’s appointee and not a career civil servant, you can’t help but hear the echoes of the many national security and foreign policy professionals who testified in the impeachment inquiry. They believed their purpose was to advance the interests of the United States, in keeping with the Constitution and the values we seek to uphold and spread. Then they discovered to their dismay that policy was being propelled instead by Trump’s personal interests.

Spencer seemed to get caught in the same tension. And here’s the important context to understand how this all happened: Just as Giuliani and others used Fox News as a tool to spread misinformation on Ukraine, those advocating for Gallagher and other accused war criminals have used Fox as a direct pipeline to Trump to plead their case and convince him to issue pardons.

Fox host Pete Hegseth has been their most aggressive cheerleader, but family members, lawyers and sometimes the accused themselves have made regular appearances on the network. In fact, after Spencer was fired, Gallagher quickly went on Fox to praise Trump and attack his superior officers in the Navy, an extraordinary thing for someone on active duty to do.

Or at least it was extraordinary before Trump became president.

“If you set this sort of precedent, then how do you tell the next SEAL that is up on charges not to go public, not to try to undermine their superiors, not to try to change a military judgment and make it a political one?” asked Ray Mabus, secretary of the Navy under Barack Obama. It’s a good question.

From the moment he took office, Trump related to the military in ways completely at odds with how other presidents, Democrat and Republican, had conducted themselves. He regularly talks about “my generals” and “my military” as though they are his personal property. He goes in front of military audiences and gives overtly political speeches bashing the opposition party.

Likewise, Trump twisted U.S. foreign policy into a means to help him get reelected.

There might be some small agencies here and there in the federal government that have resisted the Trump virus and continue to operate with the same integrity and commitment to their mission they had before he became president. But if there are, it’s only because he hasn’t gotten around to corrupting them yet.

Read more: