Sanity is such a difficult issue - and I speak as a psychology grad. But legally here in the UK if you knew what you were doing when you did it and the Devil or Hitler or whoever didn't 'tell' you to do it then you are culpable and will be treated as a felon rather than as a sick person. Not ideal but I suppose a line has to be drawn somewhere.