It's a plot device.
If Batman never caught any of these villains, his abilities would be really open to question. But then in order for the series to exist beyond a few years, either you'd have way too many new villains, or it would get watered down to cop show status, which would beg the question of why not just leave this work to the cops. And certain of the villains are so intriguing readers want to see Batman pitted against them again. So they have to escape, and it's more plausible that they might escape a psychiatric facility than a maximum security prison.
Besides, making them "insane" a) adds to their super-villain status, and b) gives writers a little more flexibility in treating them: their motives have more scope, and arguably it's a little easier to "love to hate" them if you can keep telling yourself they're not wholly responsible for their nefarious deeds.
But yeah, before Arkham, they were forever breaking out of prison. My brother used to call it the revolving-door jail.