idiom. If you're in the closet, and in that closet is a dog, horse, pig, cat, bird. or other member of the animal kingdom, and if you and your friend from down the food chain are making the somewhat-literal beast with two backs, then you are in the barn--even if you're actually in your mom's basement.
Real citation: "Zoophilia is only a problem if it becomes a fetish or a compulsion. Otherwise, it is only people's irrational fear and disgust that keeps us in the barn, so to speak."
(A Seattle Dog Lover, "What Dog Fuckers Have on Their Minds," Aug. 15, 2005, http://www.villagevoice.com/people/0533,websavage,66870,24.html)
Made-up citation: "It can get lonely in the barn, when society doesn't understand. It can also get pretty conjugalicious in there. Mooooo!"