He's a lunatic; but, he's not crazy.
The law grants the insanity plea only when someone is proven to be so mentally unstable that they aren't aware what they're doing. Robbing a Bank and manipulating cops and mobsters takes premeditation; something that contradicts insanity.
The Guy did some crazy things; but, he was not mentally ill. He's an anarchist he wants this; this is his joy, he knows what he's doing is wrong; but, he doesn't care.
Thats a lot different than not knowing what you're doing. Remember why they didn't want Falcone in Arkham in BB? Because it was the easy way out;criminals need prisons and mentally challenged dangers need arkahm. Joker was the former
"You're crazy"
"No I'm not...No I'm noT"