Interesting work in contemporary political philosophy looking at the "discursive" effects of banning some speech, like inciting hatred or glorifying Nazism.
https://link.springer.com/article/10.1007/s10677-022-10335-3
Arguably, executions could fit that mould too. Holding an explicitly rehabilitative value for justice, with exceptions for like, racial animosity motivated hate crimes, would serve as a way for society to powerfully condemn that kind of hatred more strongly than it could were it to treat it like any other offense. There attitude being, "yes, we are committed to free speech, tolerance, and rehabilitative justice. Glorifying Nazism is SO anathema to those principles that it deserves making an exception to be retributivist in this instance as a means of doubling down on our commitment everywhere else. Not only do tolerant/rehabilitative approaches to society and justice have the moral high ground, but they do in fact deserve unapologetic assertion of such, and laws can act as mode of communicating that commitment.
Had all the actual Nazis been executed after the war it WOULD be a powerful message throughout history. We will not tolerate this kind of hatred BECAUSE it is incompatible with civilized society. It deserves no safe haven, and the consequences are too inhumane to rehabilitate. All civilized people deserve rehabilitation, so best stay within the bounds of civilized positions. The problem is the liberals cannot coherently handle "view point discrimination," the free speech principle underlying US case law but not other countries' like Germany. You get silly splits where Palestine Action is proscribed but so is Nazism. It's on us, dialectic materialists, to see through the fog of idealism and demonstrate that difference. Instead of sitting around crying about hypocrisy we have to provide the better argument.