Hey Abu,
What you describe is basically the rule of Just war that is making the distinction between entering into war for a Just reason and conducting war in a Just manner. (Jus in bello and jus at bellum)
Why wars are declared or occure is different from how they are conducted. The aim of this is to preserve the humanity of the combattants by accepting that war are spaces in the real with different rules and moral understanding. But saying that, the warriors or soldiers still have and are part of humanity. What political leaders may ask them to do may be unjust and then the responsability lies in the hands of the decision makers. But also, as Stan pointed out, combattants have the obligation to refuse unjust or illegal orders. The definition of unjust or illegal orders is unclear and vague, I agree.
And I would not dare to juge whitout knowing the responsability of individuals in a war zone. Choices made are harsh and difficult under high pressure. But still law as the realisation of moral standing in the real has to be preserved.