Obviously these people are seriously mentally disturbed, and while their crime is utterly abhorrent, medieval torture as a response is really not going to do any good, except for the Self-Righteous Brothers who think they have the moral highground to react in such a manner.
We can't stop it happening, any more than we can stop schizophremia, bipolar disorder, Alzheimer's and an endless list of mental conditions - they are part of the human condition until medical science advances enough to erradicate them.
In the mean time, gnashing your teeth it futile and only hurts you - not them.