I don't think you understand what "insanity" is. Insanity isn't waking up one day with the urge to kill somebody. Insanity isn't the ability to kill one person, forget about it, and kill another person.
I don't think you really understand the broad spectrum of what insanity actually is. People can wake up one day and suffer from a mental illness, it can be triggered by a traumatic event in their lives. It is not always a slow-build up that can be measured and controlled.
When signs of that appear, a person should get help, no matter what.
If someone is a sociopath then they have no empathy. They have no reason to turn themselves in, or to seek help. If they enjoy seeing someone in pain, why would they they say or do anything that could lead to them being imprisoned, or unable to achieve the same pleasure ever again?
I'm generalizing here but these are the people who would fall under the banner of Antisocial or Dissocial personality disorders, Though both tend to correlate to genetic predisposition, Sociopaths tend to behave in this way because of the experiences they have had in their life, or the way they were raised, while it is believed Psychopaths are more inclined due to hereditary aspects.
Insanity is seeing things that aren't there and hearing voices that aren't there. When signs of that appear
The second type of insanity you mentioned is generally associated with varying degrees of psychosis. Psychosis is associated with loss of contact with reality and thus cannot be dealt with in the same way that you would deal with someone with DSPD. In some cases the symptoms will be minor and the person will be able to seek help, but in many cases they will not be able to do so.
If a person has lost contact with reality, through no fault of their own then they cannot be blamed for the actions they take. To ignore insanity as a viable reason to waive punishment is ridiculous.
If someone is seeing an entirely different world to the one you or I see, then they cannot be blamed for their actions. In a sense they would be taking logical actions, just in a space which is outside of our own understanding. To try and punish someone like this; would be barbaric.
Although Psychopath, and Schizophrenic both fall within the category of someone who has a mental disorder, they are by no means the same. In both cases they are not the subject's fault - it is an illness and should be treated as such.