The Simpsons are at a baseball game and Bart catches a fly ball, pushing the Springfield Isotots into the championships. The next day, Marge is shopping at a department store, but Homer is tired and can't find a place to sit, so he lies down on a mattress and ends up falling asleep. However, when he wakes up, everybody is staring at him, so he gets up and exclaims his love for the mattress and manages to sell five; he is promptly hired as a mattress salesman.
Springfield is playing Shelbyville in the championship, and is leading 5-2 in the bottom of the ninth with two outs, but Shelbyville has the bases loaded. When their batter hits the ball that could decide the game, it heads towards Bart. He drops a pop up and repeatedly fails to pick it up, allowing all four runners to walk the bases and score, giving Shelbyville the 6-5 victory. The crowd turns against Bart, who flees the stadium. When Chief Wiggum offers him a ride to safety though, Wiggum drives him back inside the stadium to allow people to throw food at him. Bart is totally humiliated and has now become the town's outcast.
At Homer's new job, he assists Apu Nahasapeemapetilon. The Lovejoys approach him with a sex problem, so Homer sells them a new mattress called The Snugglux by Matrimonium. The Lovejoys buy it, but bring it to the Simpsons house the next day, with their problem unresolved. As Homer is writing them a refund check, the Lovejoys begin to make out on Homer and Marge's mattress, and trade their new mattress for it. That night, when Homer and Marge are unsuccessfully trying to have sex, Homer admits he traded their mattress. He also admits that he spent the money they kept in it on a chain originally made for Elvis (which Elvis rejected for being too tacky). The next day, the Lovejoys are both singing joyfully and giggling at the Church.
Bart's humiliation goes on as Bill and Marty tell everyone on the radio, and Jimbo, Dolph and Kearney sing a song about it called Bart Stinks. The town continues to angrily mock, chastise and boo Bart for losing the game. Lisa tries to cheer him up by taking him to see an old baseball star (Joe La Boot) who dropped a fly ball in the 1943 World Series but still grew up to be rich and famous, though Grampa still makes fun of him. Unfortunately, after the baseball player learns who Bart is, he makes everybody in the building boo him. Bart begins to cry because he is hurt and Lisa is shocked with La Boot's hypocrisy. The next morning Lisa awakes to find a deranged Bart has spray-painted "I HATE BART SIMPSON" on everything in town—including a passed-out Barney and the water tower. As Bart hovers by the edge, he threatens to jump, and does so after Chief Wiggum goads him into doing so. A shocked La Boot tries to catch him, but misses, and Bart is knocked unconscious.
He survives and is treated by Dr. Hibbert. While Marge is visiting him in the hospital, she hears voices chanting "Bart sucks!" over and over, eventually seeing an angry mob outside. Finally fed up with all the abuse poured onto Bart, she walks out to them and angrily scolds them for going too far, indicating the billboard labeling Springfield the "Meanest City in America", and remarking that, more than ever, they deserved to be called that today. Feeling guilty, the entire town apologizes to Bart for hurting him and agrees to do the game over. After 78 tries (some flying into orbit, some stolen by Homer, one where Moe ran naked on the field, and even one in which the ball was disintegrated by a lightning bolt), Bart catches the ball, winning the game.
Homer and Marge sneak in to the Lovejoys' home to steal back their mattress, but the Lovejoys return and excitedly rush up to bed. Reverend Lovejoy solves the problem Solomon-style—he cuts the mattress in half diagonally and gives one half to Homer and Marge. On the way Homer convinces Marge to drive behind a billboard where they have sex, just as they did on their honeymoon—complete with the same bum watching them.
60 years later, a 70-year-old Milhouse nearly lets it slip to a 70-year-old Bart that the game was faked to make up for his lack of talent. Bart then cries again, and the ghosts of Homer and Marge watch Bart taunt Milhouse, and Homer attempts to talk Marge in to having ghost sex with him, only for Marge to tell him that "ghost sex is nothing".