The US armed forces are not run as a democracy; it is an oligarchical tiered serfdom as near as I can peg it. When you sign up, nearly everything you agree to is in a binding legal contract with the US government, and if you breach contract, it is very different than breaching a normal contract. Part of that contract is that normal courts of law and their rules are secondary to military courts and all of their very, very power imbalanced rules.
Source: myself, a decade in the Marine Corps, witness in several Non Judicial Punishment cases, and one Courts Martial case.
here's James Mattis's take on the difference between civilian courts and military courts:
> ...remember that the Uniform Code of Military Justice is established under the U.S. Constitution, because our framers knew that those we give weapons to in this country have to be governed by a different set of regulations than the population at large.
> And under the Uniform Code of Military Justice, which was the latest in a history of these rules that came out in the late 1940s and modified often since then, the defense is actually stronger. The defendants' rights are actually stronger in a military court than in a civilian court. Just read F. Lee Bailey's book, "The Defense Never Rests." And as one of the most aggressive defense counsels in our history, he said he would rather a court--defend--defend in a military court than a civilian court in his book.
> And the reason is you have more rights in order to prevent the military court system becoming what you and I would call a "kangaroo court." So, you give the defense more rights. And when that court acts, you--for most of us in the military who have an intimate knowledge of it, we have a great deal of confidence that justice has been adhered to, in the true sense of what justice is all about toward a person accused of a crime by the government.
Source: myself, a decade in the Marine Corps, witness in several Non Judicial Punishment cases, and one Courts Martial case.