The jealous dog sees other people or pets as a rival for your attention and love. He tries to force himself in between you and someone else or another pet. He may challenge a spouse when they try to snuggle next to you on the couch or in bed. A jealous dog may attack another pet that gets too close to you. He’ll try to push another pet away so he can get your attention. He’s afraid of losing your love and attention. (quoted from canidae.com/blog/ Linda Cole)
Unfortunately, as with other non-accepted behavior, we have taught them it’s ok to act like that. We even unwittingly reward their actions with attention, even if it is negative attention! As long as there is a reinforcement for the behavior (sometimes the payoff is that he is allowed to do the behavior), the dog will continue the behavior. Removing the reward is the first step toward changing the behavior.