Well put!
Sometimes we do convict mentally ill folks for crimes, but only if it can be shown that despite their disabilities they must have had guilty mind. But these same people are usually then held in a controlled mental hospital. Ronald Cray was held for life in a mental health wing of a secure facility, for instance. The boys who killed Jamie Bulger were convicted but then held and treated for rehabilitation if possible. etc etc
You asked about 'moral acts' in your OP, and it has to be said that Public Painful executions can only be an example of an unhinged culture, and executions like that for adultery, LGBT actions, certain insults to parents etc....... is beyond unhinged.