It is show-and-tell day at Springfield Elementary School, and almost every student has brought a rock - except for Nelson Muntz, who has brought his usual empty tomato paste can. In order to stand out, Bart brings his dog, Santa's Little Helper, to school. Everyone is excited to see the hound, but Santa's Little Helper has to be locked up in a closet afterwards. It isn't long before he makes his way into the air vents, where he is shortly noticed by Ralph Wiggum. Groundskeeper Willie is covered in grease and sent into the vents and retrieves the dog, but Superintendent Chalmers shows up, furious after hearing about the dog. At first, Chalmers looks into Santa's Little Helper's eyes and forgives Skinner for what has happened, but after a falling Willie lands on Chalmers, this is the final straw. Chalmers fires Skinner on the spot, and Bart is left feeling guilty.
Skinner is at first at a loss for what to do, and in the meantime Ned Flanders becomes the new principal. However, he is completely lax with the rules, and the entire school breaks out in chaos, with the teachers terrified of leaving the Teacher's Lounge, riots breaking out and spreading cross-class, and even with Martin Prince locked in a cage as the class pet. Meanwhile, Skinner has rejoined the army but finds that discipline in the army isn't quite the same as it was when he was a 'Nam veteran.
Despite the chaos, Bart feels bad for Skinner, and plans to get Flanders fired. Superintendent Chalmers shows up to do another inspection of the school, and Bart tries to convince him to fire Flanders because of the chaos the kids can make with impunity. Chalmers hesitates, since he considers that all public schools will be headed this way, but then he hears Flanders ask the students to "thank the Lord" over the intercom, which infuriates Chalmers even more than the chaos, because promoting a religion in public school is illegal. Flanders is promptly fired and Skinner becomes principal again. Skinner and Bart know that they are no longer friends now that Skinner is principal again, but they decided to be friends their own way. So they say goodbye and walk off, feeling good about each other.