I think there are two reasons why he hasn't been executed. The first is what others have already mentioned: The lack of a death penalty in the state Gotham is situated in. The other is the more obvious: mental insanity plea. It's why he is often shunted off to Arkham instead of a penitentiary such as Blackgate. Because it is a recognized institution for the criminally insane.

The logical choice would be to just flat out sentence him to death. I imagine Gotham's population would have no problem calling for it and it would save taxpayers from shelling out for trials every time the dude goes on a rampage.