A lunatic asylum or madhouse; a contraction for Bethlehem,
the name of a religious house in London, converted into a hospital for
Tom o' Bedlam.
(See Tom.) St. Mary of Bethlehem, London, was founded as a priory
1247, and in 1547 it was given to the mayor and corporation of London,
and incorporated as a royal foundation for lunatics.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894