After conducting a prank on the First Church of Springfield, Bart sells his soul to Milhouse for five dollars. Bart comes to regret his decision, and goes on a desperate quest to regain his soul. In the end, he gets it back with the assistance of an unexpected source.
The Simpsons serve as church ushers one Sunday morning. Bart uses the opportunity to change the intended hymn to a song called "In the Garden of Eden" by "I. Ron Butterfly"; actually, the song is Iron Butterfly's "In-A-Gadda-Da-Vida". Reverend Lovejoy initially fails to notice anything amiss (or the lewd behavior of congregants including Homer and Marge), but eventually catches on, noting, "This sounds like rock and/or roll." At the end of the 17-minute song, the exhausted organist collapses on the organ.
An angry Reverend Lovejoy assembles the children into his office and demands that the culprit identify himself. When Milhouse sees a crow squawk at him menacingly, he immediately rats out Bart. As a punishment for his prank, Bart is instructed to clean the organ pipes... and for being "snitchy", Milhouse is forced to assist Bart. Bart blames Milhouse for snitching on him, and when Milhouse says he feared crows pecking at his soul for eternity if he didn't tell, Bart scoffs at the very notion of having a soul, saying there is no such thing. Milhouse calls his bluff, and tells Bart he'd like to buy it (in the form of a piece of paper saying "Bart Simpson's soul") for $5. He then proceeds to say, "Anytime, chummmmmmmmmmmmmmp."
Lisa tells Bart that he will regret selling his soul, but Bart is still disbelieving. Soon, however, Santa's Little Helper won't play with him, automatic doors fail to open for him, and when he blows on the freezer doors at the Kwik-E-Mart, no condensation forms. Also, he finds Itchy & Scratchy cartoons to no longer be funny (actually, he still knows they're funny but he simply can't laugh any longer), to which Lisa quotes "laughter is the language of the soul". Bart begins to suspect he really did lose his soul, and sets out to get it back.
He finds Milhouse playing maniacally with the piece of paper. Bart makes numerous offers to buy back his "soul", but Milhouse refuses each time and jacks up the price 10 fold (Bart sold his soul for $5, and Milhouse asks for $50). That night, while Marge is tucking Bart in, senses that there's something different, about his hug. Bart tries to explain, but, Marge insists on trying to figure it out. She quickly rules out nuclear war, and swim-test anxiety. She concludes that it feels like he's "Missing something. Something important.". Bart anxiously asks "Like I don't have a soul?", and Marge laughs, and tells him he's not a monster. Bart has a nightmare about being the only child in Springfield to not have a soul, and is teased as a result. Lisa also taunts Bart with a dinnertime prayer, convincing him to make a desperate, all-out attempt to get the piece of paper back.
In desperation, Bart makes a late-night attempt to retrieve his soul, having to travel across town where Milhouse and his parents are staying with his grandmother. However, the 2 a.m. visit is in vain; Milhouse had traded it to the Comic Book Guy for Alf pogs. A frustrated Bart camps the rest of the night in front of Android's Dungeon to get his soul back.
In the morning, an annoyed Comic Book Guy tells Bart that he does not have said piece of paper anymore, and refuses to disclose who he sold it to. A despondent Bart walks home in the rain, and in his room, dejectedly prays to God for his soul. Then, floating down from above is a piece of paper, with the words "Bart Simpson's soul." Lisa had purchased the piece of paper and he is grateful. While she tries explaining philosophers' opinions on the human soul, Bart maniacally eats up the paper and ignores her. Realizing how uninterested he was in about her lecture about the human soul, Lisa tells Bart that she hoped he learned his lesson from this. That night, he rests easy with the pets curled at his feet. Bart and his soul are having fun with their quirks. They win their boat race to the emerald city, proving that he did learn his lesson in the consequences of selling his soul.
In the subplot, Moe wants to expand his customer base by turning his tavern into a family restaurant called Uncle Moe's Family Feedbag, styled a la T.G.I. Friday's and Applebee's. The gimmick: If he doesn't smile when he hands a customer his check, the meal is free. To cook all of his food, Moe buys an army surplus deep fat fryer which he claims, "it will flash fry a live buffalo in 45 seconds." Homer immediately whines, "But, I want it now!"
Moe's surly demeanor and the stress of running a family restaurant by himself ultimately unnerve him, and it isn't long before he finally snaps at a little girl (who complains that her ice-cold soft drink "makes her teeth hurt"). The restaurant is a resounding failure, forcing Moe to revert the restaurant back into his run-down tavern.