Marge gets busted for shoplifting at the Kwik-E-Mart and is sentenced to thirty days in prison. Bart concocts a brilliant scheme to break her out that involves a party dress, a wig and a crowbar. But what finally springs Marge is the rioting townspeople of Springfield, who desperately need the patented marshmallow squares which Marge makes for the Springfield Park Commission's annual bake sale.
After many of Springfield's residents purchase a 'Juice Loosener', which are shipped from Japan, the dreaded Osaka Flu hits the town. Many of the townspeople are affected by the illness. Due to tiredness from having to look after the rest of her ill family, Marge accidentally forgets to pay for Grampa's bottle of Bourbon when shopping at the Kwik-E-Mart. Despite clearly being an honest mistake (made all the more apparent given her obvious exhaustion) Apu hits the silent alarm. She is almost immediately surrounded by an unusually high number of armed police, which would make more sense if she was committing armed robbery rather than her actual misdemeanor, and then arrested for shoplifting. As usual the family hires Lionel Hutz to defend Marge at her trial and as usual, he loses the case. She is sentenced to 30 days imprisonment at Springfield Women's Prison. Apu, who now believes that Marge is a hardened criminal, believes that her being behind bars will end all further problems for him. He would later regret thinking that when he learns too late it hadn't ended his robbery problems wutg Snake driving a truck with the entire Kwik-E-Mart loaded onto it heading for Mexico.
At the Springfield Women's Prison, Marge makes friends with some of the inmates such as her cellmate, Phillips and Tattoo Annie.
Marge's absence is felt at home as Homer struggles to cope without her, and the family home is in a dreadful state. The annual bake sale also suffers: Without Marge's marshmallow squares nearly everyone attending the bake sale leaves disappointed, the Springfield Park Commission fails to raise enough money to pay for a statue of Abraham Lincoln. They purchase one of Jimmy Carter instead, which disgusts the townspeople and leads to a riot; at one point the statue is used as a battering ram. Lead by Homer and Maude, the townspeople demand the release of Marge at once.
To save his career Mayor Quimby releases Marge from jail (to win over the female voters), and the people of Springfield cheerfully welcome her back. They even unveil a statue for Marge, which is actually the statue of President Carter with Marge's hair stuck on top of it. Later on, Homer and the kids rush to clean the house in preparation for Marge's return.