The Allies established a procedure in which obeying illegal orders is a crime, also we have the oath to uphold the Constitution. Both are pertinent.
Consider the video "Collateral Murder", nearly everyone has seen the shooting scene, but it's the build-up revealed in both the full 30-some minute video, and in the edited-down 17 minute version that shows a problem: we see 8 men coming from different doors and directions, 2 armed (like bodyguards), 1 with a bulky video setup. They mill around as if waiting for more arrivals, or a ride, or a meeting to start inside, etc. They are aware of the circling helicopter and the video man kneels and takes a shot of it as it goes behind a building. While behind the building, the heli crew get permission to "engage" based on the description of "8 armed men moving out", then we see the first shooting scene, a lot of shots taken at the few who manage to run and dive. Soon a small van drives up and 3 men pick up one wounded, the G.I.s again get permission to "engage", this time based on a "Bongo van picking up weapons". It gets shot up, and a bit later ground troops arrive, and the saving of the wounded children, etc. Oh, yes, and the audio of the heli crewman when they find the kids: "well, it's their own fault for bringing children to a war zone".
Sure, it's illegal to kill civilians, and so is a war of aggression based on lies, but the leaking of evidence is the crime being prosecuted.
As for endangering troops is concerned, how about making a hundred thousand troops live in a shooting gallery for a decade? Any endangerment there?
Note: on the Oct 7 anniversary of the Afghan military action, the press clip of resident G saying the reason was that Afghanistan had provided training camps. So we turn two entire countries into training camps in which we provide the targets and fund both sides! What a scam, anyone who objects to occupation is behind 9-11. The miss-use of our troops is unmitigated disaster for everyone except those who profited hugely, but let's punish evidence-leakers!