One wonders why such a typical Americanism was not coined until early in the present century.
We suspect that it must have come from the fertile imagination of Sime Silverman, the editorial genius and apt word-coiner who guided the theatrical journal, Variety, until his death in 1933, but if so, I find no proof.
The earliest record is in 1912, in a novel by Henry Sydnor Harrison. Even the derivative, “batty,” a slang equivalent for crazy, was a later development.
The explanation is simple: as “belfry” is that part of a church tower in which the bells are hung, it suggests, therefore, the head.
Bats are known to be frequenters of bell towers; they fly around crazily; ergo, they are crazy. Hence, to have bats in one’s belfry is to be crazy in the head.