Springfield is "in the grip of lottery fever" with a $130 million jackpot and, as a result, no one in the Simpson family notices that their pet dog, Santa's Little Helper, has become ill. Once the dog is discovered to be sick, the family rushes him to the animal hospital, where they learn that he needs an emergency operation to cure gastric dilatation volvulus which will cost $750. Homer is saddened to tell his children, Bart and Lisa, that the family cannot afford the operation. However, after seeing how much everyone loves the dog, especially Bart, he decides to find a way to pay for it.
Everyone in the family has to create a lot of budget cuts in their daily routine, such as Homer having to give up on buying beer and Marge having to cook with lower-quality food and forgo her weekly lottery ticket. Bart must get his haircuts at a local barber school, Lisa can no longer get her volumes of "Encyclopedia Generica" and Maggie's clothes have to last a little bit longer. They eventually save up enough money for the operation, which is a success. The family is joyous that their dog is well again, but soon begins to feel the strain of their sacrifices. As a result, the morale of the family suffers and they take their annoyance out on Santa's Little Helper. Feeling unwanted, he runs away from home and goes off on an adventure, only to be captured, taken to the dog pound, and adopted by Mr. Burns, who trains him to be one of his vicious attack hounds. After a long brainwashing process, consisting of the Ludovico technique, Santa's Little Helper is turned into a bloodthirsty killer.
The family begins to regret all the disgusting things they said about their dog, and Bart goes from house to house asking if anyone has seen him. When he arrives at Burns' mansion, Santa's Little Helper, along with other vicious dogs, tries to attack him. However, when remembering all the good times they had, Santa's Little Helper snaps out of his brainwashed state and protects Bart from the dog pack, before returning to the Simpson family, who shower him with love. Before the show ends, they put in subtitles saying "No dogs were harmed in the filming of this episode" and "A cat got sick and somebody shot a duck but that's it".