A doghouse was an accommodation for dogs. Being "in the doghouse" was a metaphor for being in trouble. (DS9: "Prodigal Daughter")
In 2369, Chief Miles O'Brien likened creating a place for the computer program known as "Pup" to building a doghouse. (DS9: "The Forsaken")