All people have different brains; some are very low-intelligence and impulsive by nature and training, and this can apply at any age. The point of this punishment is not to apply a sort of cosmic morality according to the true culpability of a soul. Abstract principles about whether the person 'deserves' a punishment aren't actually relevant regardless of what shape their brain is. The point is the real-life consequence of their criminality on others, and how to stop them hurting people. We must stop them hurting people; let's figure out how.
This dedication to abstracted principles and cosmic morality over fixing the actual issue is really problematic; I see this more and more these days.