When mental health problems play a central role in the commission of the offence deterrence and punishment assume less importance. 

R. v. Batisse, 2009 ONCA 114, 93 O.R. (3d) 643,t para. 38, per Gillese J.A; see also R. v. Dedeckere, 2017 ONCA 799
The impact of mental illness on the offender’s judgment may be a factor reducing the moral blameworthiness of the offender.

See R. v. Dedeckere, at para. 15. 
A sentence must be fit having regard to the particular crime and the particular offender.
Where the offender’s criminal conduct is driven by mental illness, it is an error for the sentencing judge not to consider an offender’s serious and longstanding mental health issues as part of that offender’s circumstances.

R. v. Dedeckere, 2017 ONCA 799, at para. 16.