International humanitarian law proscribes certain actions in war, particularly actions that harm non-combatants. On a strict reading of these laws (see what Richard Goldstone said in his debate with Dore Gold at Brandeis University here and see what Matthew Yglesias had to say here), these actions are prohibited regardless of the justice of the war itself: there are certain things that you are just not allowed to do, no matter what. The natural response of any warring party accused of violating humanitarian law and confronted with this argument (aside from simply denying having done the things they are accused of doing) is to insist that their actions in the war cannot be judged outside the context that led to them going to war in the first place. They are the aggrieved party, they are in the right, and they did what they needed to do to defend themselves. Any law or law enforcer who fails to understand this critical distinction between the good guys and the bad guys is at best hopelessly naive and at worst actively evil.
What to make of this response? On the one hand, the position taken by Goldstone and Yglesias can't strictly be morally right. No one really believes that moral obligations in a war are completely independent of whatever caused the war in the first place. For example, it can't but be the case that the set of morally acceptable actions if you are defending yourself against annihilation is different from the set of morally acceptable actions if you (justifiably) take offensive action in response to some relatively minor provocation. (Which situations justify which actions is, of course, a hugely important question, but it is not the point here.) On the other hand, the whole point of constructing humanitarian law to be independent of the moral claims surrounding the war itself is that while there is at least one wrong side in every war, there is no real hope of getting the warring parties to agree on which side that is, so the only way for humanitarian law to make them behave any better is by side-stepping the whole issue of who's right and who's wrong.
So any sensible moral standard demands that the context be considered, but there is an excellent reason why the legal standard requires that it not be. What to do? Since requiring that the context be considered would pretty much be the end of humanitarian law, the question boils down to whether the benefits of a neutrally-administered humanitarian law are worth whatever injustice would be suffered by the occasional country that gets condemned for doing an illegal but morally justified act. I think it's clear that these benefits far outweigh the costs, but in any case that's the tradeoff.
P.S. Though I used Goldstone as the example to motivate the post, I deliberately stayed away from discussing the specific war that he was talking about. I don't think my views on that war can be inferred from what I wrote in the post, but in any case I would ask that folks not argue about them in the comments, not because it's not important, but because this isn't the right forum for it.