It's hard to understand why someone would deliberately harm a small child. It's hard to understand how someone would engage in conduct which most would find unquestionably evil, such as torturing and murdering anyone.
Whether a person can be described as evil is a question sometimes debated in philosophy, and in law. Various issues arise, e.g. whether a person is more properly considered sick than evil. Clarence Darrow, it seems, felt that no person could properly be held responsible for his actions.
Accepting that people should not be allowed to torture and murder, and that it is one of the functions of government and law to prevent this from occurring, it would seem, though, that such questions are immaterial, in the sense that whether the torturer/murderer is sick or evil he must be prevented from doing so in the future. He should therefore be isolated until it can reasonably be determined that he will not do so again. If it cannot, then he should remain isolated.
It is more a question of safeguarding others, than determining responsibility. If someone presents a danger to others, prevent him from being a danger to others, regardless of the reason why he presents a danger. Punishment need not be the end, and it seems an unnecessary consideration.