It's not about warfighting being a 'legal exercise' or not (which is surely ain't), it's the fact that we, even though we are soldiers/sailors/Marines and are responsible for bringing the righteous hand of God down on our enemies, remain employees of the federal government, and the military as a whole is still an arm of the government, and is therefore bound to follow the laws set before us, just the same as everyone else. Now don't get me wrong, I'm all for eating my morning cereal out of the skulls of dead terrorists just as much as the next guy, but I'm not about to violate the legislated-and-judicially-reviewed laws of my country or dishonor the Constitution I'm sworn to defend.
We are still beholden to our civilian leaders (SECNAV, SECDEF, all the way up to the President), and their laws are absolutely our laws too. Granted, the UCMJ deals with the differences between the military and civilian worlds, but the basic rules are the same; don't murder people, don't screw someone else's wife, don't steal things, don't help the enemy, etc. There's something important that needs to be said though, because this debate will continue for as long as there is a separate military and civilian sector; The military is not, and should never be, an instrument of social change, no matter what the voting public thinks, but we can't fall so far behind the rest of the nation in terms of social policy that we are going against the public's opinion, or we'll lose their support. Loss of public support = no money to blow stuff up and kill people.