After a series of misadventures, the Simpson children are put in the custody of Ned and Maude Flanders. Learning that none of the kids have been baptized, Ned sets up a baptism - which Homer and Marge thwart just in time.
Homer gives Marge a surprise trip to a relaxation center. Despite Marge's warning for them to clean up the mess and give the children fresh clothing before they leave, Homer refuses and willingly abandons the children under the ineffective care of Grampa. Meanwhile, Bart has gotten lice from Milhouse's monkey, forcing him to have his clothes burned by Groundskeeper Willie. Meanwhile, Lisa has had her prescription shoes stolen by bullies and hung up on telephone wires. They come home wearing bags, finding that their parents are not home and the child welfare agency (prompted by Principal Skinner) has taken offense at the poor conditions of the house (the household chores were simply postponed, but the agency misinterprets such signals as a stack of 20-year-old newspapers obtained for Lisa's history project, and Grampa is sleeping on the family couch). Homer and Marge arrive as the agents take Bart, Lisa, and Maggie away from their house, as they convinced Marge and Homer are bad parents.
The Simpson kids are taken to a foster home - right next door, at the house of Ned Flanders. The kids have to deal with Flanders' style nachos (cucumbers with cottage cheese), bedtime when there's still light, and hours of Bible Bombardment. Bart and Lisa hate it, but Maggie enjoys being there, not just because she's a baby but also because the Flanders pays her more attention than Homer did. Ned allows Bart and Lisa to watch Itchy and Scratchy just one time. However, the violent nature of the show as well as Rod and Todd's discomfort, leads Ned in banning Bart and Lisa from watching it to their further detest.
Being left with Homer and his father, Abe, Marge scolds Homer for not letting her clean up and leaving Bart, Lisa and Maggie filthy under his father. She claims that he should have at least let her call her sisters, Patty and Selma, to watch them more effectively and help clean the house. Homer tries to defend himself, claiming he didn't want her calling her sisters to care for their children, even if they were more effective than his father. However, Marge tells him that she doesn't want to hear more of his excuses because this is the last time she lets him talk her into pleasuring herself over their children's welfare. She runs inside the house in despair, while Homer is feeling guilty over hurting her. He then berates his father for not getting alerted earlier about the Child Welfare Agency that could have given them time to come home and clean up. Abe claims that Homer complains at him too much and tells him that he can deal with his own problems. Abe heads back to the retirement home he lives at, while Homer stews in anger and decide that he and Marge must plead their case in court. At the Springfield County Courthouse, they plead their case to get their children back. However, a judge presiding over the case, tells Homer and Marge that in order to get their children back they must attend a Family Care Class and prove they are fit parents. When Homer tries to interrupt her, Marge warns him against it because they don't want to add a contempt of court charge to their precarious situation and make Child Welfare more convinced that they are terrible parents.
When Ned finds out from Lisa that none of the Simpsons children were baptized because of Homer's lack of belief in God and didn't believe baptism is necessary, he faints and calls on Rev. Lovejoy for advice. Convinced that Homer was a terrible father, Ned takes it upon himself to give the kids a proper baptism, much to Bart and Lisa's fears.
Meanwhile, since there's no way for Homer and Marge to talk to their children, even by phone. Bart and Lisa help them out using a newspaper editing machine that Rod and Todd has and lets Homer and Marge know how much they miss being Simpsons. With a sense of newfound hope, they take classes to become better parents as they are forced to attend a basic class on home care, including such lessons as putting garbage into garbage cans, and leaving milk either in a refrigerator or a cool, wet sack. While Homer learns well, Marge is genuinely humiliated and Goodman is concerned she is struggling. Pulling her outside of the Family Care Course, he and another teacher asks her what's wrong. Marge admits she finds both the class and Homer's actions humiliating. She reveals that whole story of what happened when she came home to discover that her kids were dirty. This was evident earlier in Homer's behavior when they left for their spa date by leaving the house along with Bart, Lisa and Maggie in the lack of care of his father, rather than let her call her sisters to help watch them or let her tidy up before they left. She realizes the consequences it had that lead to both her and Homer losing their children in the first place. She tells Goodman she loves Bart, Lisa and Maggie so much that she will do what is necessary to get them back. He understands Marge's plight, but Goodman reveals that he is doing this not to humiliate her but also teach her and Homer to become better parents. Although she presumably fails the class, it was revealed there was a marginal error between the scores and Marge actually passed. In the end, she and Homer are declared fit parents.
When they go to pick up the kids, they see only a note saying "Gone Baptizin'". They quickly head for the Springfield River, where Ned is about to baptize Bart. Homer arrives at the scene just as Flanders is about to sprinkle holy water over Bart's head (baptism as practiced by Protestant and Evangelical congregations tend not to involve the use of holy water at all). Homer pulls Bart over and the holy water falls upon Homer's head instead, baptizing (or burning) him. Homer has a moment of grace after his baptism and confuses Ned. He quickly reverts to his old self and angrily reclaims his kids from the Flanders. Nevertheless, Maggie would rather stay with the Flanders than with Homer, Bart and Lisa, until Marge shows up. Her reluctance disappears when Marge arrives in the sunset to pick her up and resumes being a loving mother to her. The Simpson family is back together again, and they head home together, mocking the old paint cans in Ned's garage. Homer and Marge apologize to Bart and Lisa for what happened and promises that Grampa will never again babysit them.