Used for criticizing someone's selfishness, especially when they deny others something they can't use. He's keeping all these books just to spite me, such a dog in the manger.
Pro Tip 2/3
Not Literal
It's a metaphor; no actual dogs or mangers involved, focuses on selfish human behavior. She won't let anyone else book the meeting room, a real dog in the manger.
Pro Tip 3/3
Negative Tone
Conveys a negative judgment, implying pettiness or unnecessary possessiveness. He's a dog in the manger, hoarding supplies he never uses.