The first part of a new series explaining idioms:
In the olden days, when wives were far fiercer than they are nowadays, husbands would often have to spend the night in the doghouse, cuddling up to their furry best friend instead of spooning with their better (or maybe worse) half. The punishment of having to spend a night in the doghouse could be handed out for any number of reasons. Forgot to kiss your wife on the cheek after coming home from work? Get in the doghouse. Burned a piece of toast? Take it with you to the kennel. Eat there. Sleep there. Relieve yourself in the garden.
Of course, these days, women are far kinder and refrain from forcing their menfolk to sleep outdoors. In fact, most families allow their dogs to sleep in the human-house, and don't even use a doghouse. Yet we continue to use this phrase to refer to the state a man lives in when he has done something wrong. So, men, be careful not to burn your toast and always be nice to 'her indoors' but also be thankful that you live in an enlightened age and don't have to sleep in a small hut in the garden, being slobbered on and snored at by a dog.