Your viewpoint sounds good in argument on forums, and I'm sure it scores you points.
But there's a reason they used to execute people in the public square.
But there's a reason they used to execute people in the public square.
Capital punishment has never been about deterrence, nor has it ever been an effective deterrent.
Not even once?
But that was far from the norm. In the hope that you might actually go and educate yourself somewhat on the topic, here is the Times report on the last public execution ever carried out in England, that of Michael Barrett on 26 May 1868.
https://www.arthurlloyd.co.uk/Timeline/Execution.htm
It certainly sounds like it had the effect you claim it does, doesn't it?