1902 (n.) "insane asylum;" 1891 (adj.) "insane," from bug (n.) + house (n.); perhaps originally tramps' slang.
Crazy; nuts: He's a bughouse pimp/ The local constabulary haul the bughouse blighter off to prison (1895+)
An insane asylum: Who cares whether you're free or locked in a bughouse? (1900+)