Criminals are not given the death penalty if it can be proven that they are insane, or something similar. Actually, in many cases these days, murderers have plead "temporary insanity" and avoided the death penalty AS WELL as prison.
Defense attorneys are pretty tough in their defense of "the accused", as they choose to refer to them. Some of the most intelligent and clever attorneys I know are criminal defense and they're unwavered in their defense even if it is pretty evident the person is guilty of whatever crime. Believe me, if there is enough question as to if the person was insane, coerced, emotionally destraught (crime of passion) or the like, their chances of getting the death penalty for murder aren't very high.