On Father's Day, Homer is profoundly impressed by Bart's gift—a Leather Buddy multi-function knife, which he fantasizes about rescuing Marge from pirates—and proudly tells Bart that it is the greatest gift any father could receive. As for Lisa's gift (a book she created, disgusted with the "mass-produced junk" that does not adequately convey her feelings for her father; with caricatures of herself and Homer as unicorns), it does not go over so well. In a half-hearted attempt to make Lisa feel better, Homer hangs the book on the refrigerator, but it quickly becomes a water-soaked glob of paper when the book falls into the refrigerator's water dispenser. Homer blames the magnet, which (ironically) turns out to be a magnet that Lisa gave Homer for his birthday.
Lisa takes out her frustrations at school, leading her into trouble, and her parents are called to talk with Principal Skinner. School psychiatrist Dr. J. Loren Pryor determines Lisa is going through a developmental condition spurned by Homer's antics and could wind up hating men for the rest of her life, which can only be resolved by Homer trying to make amends for everything. He does so by dressing up as The Safety Salamander, who is meant to warn children about electrical power lines. Before accepting the job he asks "What happened to the last Safety Salamander?", to which Skinner responds "Uh, he fell asleep in the suit and suffocated". However, while on the school bus, Homer causes myriad dental injuries when he has Otto stop the bus promptly, and then a fireworks display during a school assembly causes a massive fire in the auditorium.
Meanwhile, Bart—on a dare from the bullies, who plant the idea in his head that he is allowed to steal public property that has his name on it, and will endure full immunity from the law—steals a "Bart Boulevard" street sign. This leads to a fiery multi-vehicle pileup when Cletus is unable to find Bart Boulevard so that he and Brandine can go to the hospital to deliver a baby. Police cars, fire trucks and ambulances race to the scene but crash into the wreck, making matters even worse. Homer, still dressed in his Safety Salamander costume, runs to the rescue, extricating people who were trapped in their cars just before the pileup explodes in a giant fireball.
Homer gets a rousing reception, and Mayor Joe Quimby is immediately blamed for the bumbling response. Springfield residents pick apart Quimby's administration for his many other failures, and after Quimby stupidly taunts the crowd by saying "I cannot be removed from office except through a simple recall election", the media notes his increasingly bizarre behavior, and Quimby is met with fresh demands for a recall everywhere he goes, even in his sleep, until he finally calls one.
On Lisa's suggestion, Homer decides to run for mayor against candidates numbering in excess of 200, from Comic Book Guy, to the Italian chef Luigi Risotto, to Springfield Elementary School bully Jimbo Jones, to newsman Kent Brockman, to actor Rainier Wolfcastle, playing on his popularity as the Safety Salamander and building a huge lead in the polls. It does not help Homer's competitors when Smithers puts out a negative advertising campaign that points out that Homer hardly ever shows up at the Springfield Nuclear Power Plant anymore, and instead pays a homeless man to do his job for him. But when Marge washes Homer's salamander costume after witnessing him vomit therein—though more generally, acting up on her own concern that his possession of the outfit has not included it being washed—it falls apart during a debate forum (where we learn that the Crazy Cat-Lady's real name is Eleanor Abernathy and is very intellectual despite her deranged rantings for "cats in everyone's pants!"), and the crowd turns on him. Eventually, none of the new candidates gain the 5% of master vote needed to oust Mayor Quimby. On his news program, Brockman states that he did not really want to be mayor anyway ("Sorry! Your loss, jackasses!"). Nevertheless, Lisa confides in Homer that she is very proud of him and glad he is her father. As they dance in the deserted ballroom, Homer notes that he cannot believe he lost "after Ben Affleck campaigned night and day for me" and Lisa sighs and says "Yeah, I warned you about that."