J. Pat Carter / AP

It came as no surprise to me earlier this month when White House Chief of Staff John Kelly offered his full-throated support to Rob Porter, a White House aide, who was accused of domestic abuse by his two ex-wives. “I can’t say enough good things about him,” Kelly said in his first public statement following the published allegations. “He is a friend, a confidante, and a trusted professional. I am proud to serve alongside him.”

While those unfamiliar with military justice may be shocked to see Kelly, a retired four-star general, publicly defend Porter as “a man of true integrity and honor,” it is sadly and wholly consistent with my experiences as a career Air Force JAG officer. Kelly’s defense of Porter is rooted in a military culture that too often values loyalty to cronies more than justice for their victims. During my time as a defense counsel, prosecutor, and judge in the military, I witnessed countless people like John Kelly and their negative impact on the fair administration of justice.

The military’s pride in intraservice loyalty is understandable. Faithfulness to “team” and devotion to “team members” allow the institution to thrive under the most challenging of circumstances. In battle every soldier, sailor, airman, and Marine must be able to count on his or her brothers and sisters in arms. However, this virtue becomes a vice when it is blindly given outside the battlefield, and in particular when it concerns allegations of criminal misconduct. (It’s worth noting that Kelly issued a second statement after photos were published of Colbie Holderness, Porter’s first wife,  with a black eye. Expressing his “shock,” Kelly said he nevertheless stood by “previous comments of the Rob Porter that I have come to know.”)

This kind of blind loyalty is not exclusive to the military—think of relatives who profess that their loved one is incapable of violence even after he or she has committed a crime. But the loyalty that a suspect’s defenders show takes on outsize importance in the military context. Backed by the tradition of the “good soldier” defense, positive testimony about a soldier’s military character can significantly affect a case’s outcome. What’s more, a soldier’s commander can decide whether a case should be brought in the first place.

The good-soldier defense is baked into the military justice system, and it’s based on a breathtakingly shallow line of reasoning: that just because someone is good at the job, he is incapable of committing a crime. Used to suggest that an accused has “good military character,” the argument alone can be the basis for reasonable doubt or dropped charges. And when testimony supporting an accused soldier’s character comes from a general or a flag officer, it can overwhelm all other evidence of guilt.

The good-soldier defense isn’t just deployed during court proceedings—it affects pretrial decision making too. In contrast with the civilian justice system, senior commanders alone determine whether a service member in their own chain of command will or won’t face court-martial. If Porter had been one of Kelly’s Marines, and under investigation for spousal abuse, Kelly would have decided whether Porter would be prosecuted.

Even if an offender is no longer under a commander’s watch, the senior officer still has the ability to put his thumb on the scales of justice. In my experience, generals often go to bat for their favorite service members in an attempt to convince another commander to drop charges. From behind-the-scenes phone calls to glowing letters and emails, senior officers can be persuasive.

And if they’re unable to derail a case from going to trial, they often still try to influence the proceedings. Time and again, I witnessed generals and admirals affect case verdicts and sentences thanks to their favorable testimonies at court-martial. I’ve seen their defense supersede photographic evidence and other testimony—including accounts from additional alleged victims. This is essentially what Kelly offered Rob Porter: the power of his word over the word of Porter’s ex-wives.

Kelly has exerted similar influence before. In 2016, he was among four Marine generals who testified during a sentencing hearing for Colonel Todd Shane Tomko. Despite allegations of sexual harassment against a subordinate—as well as convictions for violating a military protective order, illegal steroid use, and driving under the influence, among others—Tomko was, according to Kelly’s testimony, a “great Marine” and respected leader. Tomko is now awaiting a civilian trial for the alleged sexual abuse of multiple children dating back more than 15 years.

Congress recently recognized that justice should not be openly thwarted this way, specifically in the context of sexual assault. In 2015, lawmakers passed legislation prohibiting the use of the good-soldier defense in sexual assault, rape, and a few other types of cases. But the defense still used elsewhere. It is still permissible in domestic-abuse cases, for example, and it continues to permeate the culture of the military. The “I trust him to have my back in combat” mentality is still fueling the reflexive support of the offender over the victim.

John Kelly’s over-the-top support for Porter was wrong. But Chief of Staff Kelly was only acting as General Kelly would have. His statements highlight the fundamental flaw of the military’s commander-controlled justice system. Commanders might genuinely believe a subordinate is incapable of abuse, or they might find the subordinate too valuable to the mission not to support in court. The former is naive, the latter reprehensible—and both are reason to remove commanders from the equation entirely. Just as many members of the public recognized that Kelly’s bias disqualified him from impartially judging his aide, the country should recognize that commanders are unqualified to pass judgment on their own Rob Porters.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.