The greatest war crime of WW II were the war crime tribunals. War is state sanctioned killing. The object of conducting war is to win. If you can win by intimidation, killing no one fantastic. If necessary you exterminate your opponents entirely. Hopefully something less will suffice.
When the fighting ends, the winner decides what punishment to administer or what revenge to exact.
In WW I, the German military which had introduced gas warfare, was appalled to discover that US Marines were using shotguns against their personnel.
In WW II the British who were appalled that the Luftwaffe could stoop to bomb innocent civilians in cities on their part exclusively bombed cities at night when there could not possibly be any accurate sighting on their bombs.
If you look back in history the black flag was a tried and tested acceptable form of behavior. Any besieged city which failed to capitulate when the wall was breached was subject to mass rape, extermination of every person, theft on a grand scale.
If you want to point that in the 20th century nations had signed Accords which stipulated which forms of warfare were or were not acceptable, and in fact under the League of Nations had completely outlawed war to solve disputes. Question? If war is outlawed and some nations breaks that law, how is that nation to be punished other than other nation(s) prosecuting war against them? CATCH 22. Even ignoring this conundrum, consider that when a war is concluded it will be the victor(s) who determine who has violated the law.
Consider if the League of Nations had been formed prior to WWI. When Germany had been forced to sign the Treaty of Versailles, accepting war guilt; what if they had appealed to the League and the League had voided the treaty and its onerous reparations. What if the League had rightly judged that Germany was no more responsible for the war than Austria Hungary, Serbia,
Russsia, Britain, or France. Do have any inkling of a thought that the victorious Allies would have acceded to the verdict?
In fact it is only in the 20th Century that the concept of war crimes was allowed to take form. And oddly enough it is the rise of democracy which is at fault. Prior to that century wars were primarily between opposing monarch and in Europe given the pattern of monarchial in-breeding were essentially family affairs. Had not democracy interposed WW I probably could have been resolved with much less bloodshed and far sooner.
However once warfare became a matter of one nation state versus another; one people against another, and modern warfare requiring enormous armies, war became personal. Individual people (voters) became vested in the outcome of the war. The enormous bloodletting required that somebody had to be held responsible, ie, the concept of war crimes/criminals.