In Canada, this is what is known as the NCR (not criminally responsible) defence, which is governed by section 16 of the Criminal Code. S. 16(1) says "no person is criminally responsible for an act committed or an omission made while suffering from a mental disorder that rendered the person incapable of appreciating the nature and quality of the act or omission or of knowing that it was wrong."
However, everyone is presumed not to suffer from a mental disorder so as to exempt from criminal liability unless they can prove the contrary on the balance of probabilities, and the burden of proving that is upon the party that raises the issue. Further, the courts have interpreted "wrong" to include both legally wrong and morally wrong. In addition, suffering from a delusion is not sufficient on its own; the accused must still show that the delusion was such that it rendered him/her incapable of appreciating the nature and quality of the act or of knowing that it was wrong.
Also, evidence that an accused attempted to cover up a crime is admissible as evidence going to whether the accused was capable of appreciating that what he/she did was wrong, so concealment generally works against the possibility of a successful NCR defence that is raised.
If a person is found to have committed the offence but successfully raises a NCR defence, then they go to a psychiatric facility but there is no fixed sentence. Subsequently, they go before a provincial Review Board at scheduled intervals (every 12 months or 24 months, depending on circumstances), and they aren't released unless and until they are deemed not to be a threat to the safety of the public. So, they could (and often do) end up spending more time confined than they would had they been convicted of the offence and sentenced as usual.
Interestingly enough, when s. 16 was revised in 1992 to update the language and transfer the responsibility over NCR persons to the provincial Review Boards, there were also provisions drafted that would cap the length of time that a person could be incarcerated at the maximum length of time to which they could have been sentenced had they been (for lack of a better word) sane at the time of the commission of the offence. However, those provisions were never proclaimed into force, so the result is that NCRs can be detained indefinitely.
As to the OP and the suggestion that insane people should automatically get longer sentences than non-insane people, I disagree. This is because criminal conviction requires that a person have the necessary mens rea to be convicted of a criminal offence, and a person who is suffering from a mental disorder that precludes them from having the necessary "guilty mind" ought not be convicted at all. The NCR provisions permit us, however, to protect society from dangerous insane people, even in the absence of a "guilty mind". I think that's as it should be, and that it strikes an appropriate balance between competing interests.
All of that said, it appears that in this particular case, there is plenty of evidence of concealment, which would certainly militate against a finding that he was NCR at all, in which case a conviction and life sentence with no possibility of parole would be an appropriate outcome, in my view.