Homer books Spa treatments for himself and Marge. While Marge wants to clean the house before they leave, Homer insists that she works too hard already, and they leave their messy house in the care of Grandpa. When Bart is sent home from school with head lice and wearing a burlap sack, because he had his clothes burned to prevent contagion and Lisa all messed up and without shoes, because of a result of being continuously bullied at school, Homer and Marge are accused of being negligent parents. Two Child Protective Services agents arrive at their house and, after mistaking the temporary mess as a permanent situation, take Bart, Lisa, and Maggie to a foster home, which is right next door, at Ned Flanders's house. Homer angrily blames Grampa, though Grampa dismisses him.
The kids have to get used to bedtime at seven o'clock with the sunlight still out, and hours of Bible board games. Bart and Lisa hate the Flanders house, but Maggie enjoys being there as she gets more attention from the Flanders than she did with Homer. Meanwhile, Homer and Marge have to attend a special class for bad parents so that they can get their children back, where they also find several other Springfield parents, such as Agnes Skinner and Cletus. Despondent, Marge and Homer try to contact their children, but the Flanders number has been blocked by Child Services. However, they find a message from Bart and Lisa on their doorstep, telling them that the kids miss them too.
When Ned finds out that Bart and Lisa were not baptised, he takes it upon himself to give the kids an emergency baptism. Marge and Homer are declared decent parents, after a brief misunderstanding where Marge somehow tests positive for crack and PCP on a drug test, and they quickly head for the Springfield River to stop Ned from baptising their children. Just as Ned is about to pour holy water on Bart, Homer shoves Bart over to prevent the water from hitting him. However the water hits Homer, apparently burning him and momentarily making him saintly until he goes back to his crude self. Maggie is unsure if she should return home to her family since Ned's family has been more attentive to her. Then Marge arrives in time and resumes being a loving mother to her. With a new sense of family unity, the Simpsons happily head home, with Homer asking Bart and Lisa all the sordid details about the Flanders home, though the only thing Bart can think of is that Ned has a bunch of open paint-cans in his garage, much to Homers mirth.