Insanity isn't an easy thing to prove, and it is often the defense of last resort. The belief that madness can be exculpatory is an ancient one--so ancient that it was carved into the Code of Hammurabi seventeen hundred years before the birth of Christ, alongside the notion of proportional retaliation, lex talionis, an eye for an eye...The insanity defense has been out of favor for a century. Queen Victoria tried to stifle it in the mid-nineteenth century, out of fear that it would encourage would-be assassins; a hundred years later, President Richard Nixon tried to have it [federally] outlawed. Too many defendants had turned out to be insane only until acquittal, and prosecutors and psychiatrists alike had come to worry that the defense was just a way of letting murderers get away with murder; around the country, there were examples of defendants sent to state mental hospitals after a jury decided they were insane, only to have the hospital's superintendent and staff release them after diagnosing them as sane. In response, some states--Idaho, Kansas, Montana, and Utah--banned the insanity plea entirely.
Casy Cep, Furious Hours: Murder, Fraud, and the Last Trial of Harper Lee, 2019