War crimes only get punished if someone has the might to enforce the punishment.
If all war is punished you remove the ability to enforce the punishment for all wars, it’s a paradox.
It’s also often very difficult to prove every single war crime as the administration above the soldiers is covering things up. Things need to be extremely widespread and blatant to lead to something.
Some countries just don’t get punished for war crimes because they refuse to recognize the international tribunal and it is not practical, feasible or too much of a diplomatic crisis to sue and punish their citizens. For example, Russia and the United States.