It also can be applied to extremist groups when they talk about saving an animal's life but allowing a human or group of people to die.
Usually said in a pseudo-dramatic or condescending sense, the phrase is used as a way of saying in a sarcastic manner "Your priorities are all messed up!", because at least a nice woman you can mate with, what are you going to do with a dog?
Jack: "Wait a minute. The killer just hacked 15 people to death with a chainsaw ten minutes ago and you're okay with letting them all die but 'don't hurt the doggie!!'?"