To be fair, most of those villains could never realistically get an insanity plea in court. Most people with mental issues don't go poisoning the city's water supply.
Yea, the bar for pleading insanity is that you literally cannot understand that what you did was wrong. Basically any villain interesting enough to be a "villain" surely is too sane, at least how basically any comic book villains are written.
After all, you're generally supposed to not like them, but a villain that literally cannot understand what they're doing as bad would risk a lot of sympathy. (and probably make for a badass story in the right writer's hands)