What is the meaning of going batty?

To have bats in the belfry is an old expression meaning to be crazy. The belfry is part of the steeple where the church bells are. Going batty is an abbreviation of the expression, and it means "going crazy."

"Bats in the belfry" and "going batty" are two different slang colloquialisms. Bats in the belfry is derived from bats domiciling in the belfry of church steeples and, being nocturnal, when the church bells ring in the morning the bats go all aflutter. Dazed, confused and unable to see, hence, "blind as a bat" they run into each other, walls, etc., giving the appearance of being irrational or crazy.

"Going Battie", or sometimes "Going Batty", was derived from William Battie, sometimes written Batty. He was an 18th century psychiatrist whose claim to fame was his 1758 publishing on the treatment of mental illness, A Treatise on Madness. He was the first to promote that his institutions could cure the mentally ill and his madhouses made him one of the richest men in England. Wealthy and poor alike were often drug off to his asylums for unjustified torture in the guise of treatment for the mentally ill. Victims of his inhumane practices were alleged perpetrators of crimes, the depressed, the uneducated and sometimes, geopolitical foes. His financial success fueled a boom in the asylum business and the catchphrase "going batty". If one were "going batty" they were meant to be going by the way of William Battie's treatment or going off to one of his asylums.