Denazification
Denazification was a process in postwar Germany and Austria where former Nazis were identified and, depending on their culpability in war crimes, either excluded from public life or reintegrated into society.
The worst Nazis that were identified were tried at the Nuremberg Trials and punished.
Many of the German judges that were avid Nazis and worked during the Nazi years retained their positions after the war.
The onset of the Cold War incentivized the Allies to overlook Nazi war crimes.
The Soviets adopted an attitude of hanging the "big Nazis" and letting the little ones go.