As I see it, the morality of going to war is not the responsibility of the soldier, it is his conduct within the war. So, if the war is judged to be unjust at the end of it (ie. they lose) then the soldier is not guilty of a crime - he went to war, and perhaps killed someone perfectly legally. However, if he forced a PoW to bomb up a magazine for him, he's guilty of a war crime, even if his CO ordered him to.