Homer takes Bart and Lisa to a movie and he has to bring Ned Flanders' children with him, because Ned has taken the senior citizens for ice cream to celebrate Jasper's birthday. However, at the Googolplex Theatre, every kid-friendly movie is sold out, and Rod and Todd will not let Homer see a raunchy comedy called Teenage Sex Wager since it is one of many movies condemned by a Christian publication called "What Would Jesus View?". After listening to Lenny mention he had a small part in the horror movie The Redeadening as a gardener, Homer takes the kids to see the movie. The movie is very scary, causing it to scare Bart and Lisa at home, who think they hear noises from the attic. But when they look in the attic, their fears scare them away. When Bart and Lisa arrange to have Homer and Marge look in the attic, they discover Artie Ziff living there.
Artie Ziff explains that he was living in the attic because he ran an unsuccessful Internet business, Ziffcorp, and lost all his money after spending it on many extravagant items which then got repossessed (including the repo vans). He chose to live with the Simpsons because he claims that Marge was the closest thing he ever had to true love---although Marge quickly points out that she and Artie only had one date and reminds Artie of how he almost raped her on their high school prom night as seen in "The Way We Was." Artie promises that he won't hit on Marge if he stays with them, which Marge objects to, but Homer, Bart, and Lisa do not. While living with the family, Artie connects with Lisa by reading her The Corrections. He then tries to buy ice cream for Bart and Milhouse, but, when Artie's credit card gets cut up, he attempts to hang himself (which does not work as the noose is not on his neck tight enough to kill him nor is Artie high up off the ground for a hanging to be physically possible). Homer gets Artie down and takes him to Moe's.
Marge sees on the news that the SEC is looking for Artie Ziff. Meanwhile, Artie's playing poker with Homer and his friends. Homer wins 98% of Artie's company's outstanding stock. The SEC sweeps in to arrest Ziff, but Homer says he owns 230 million shares of Ziffcorp, making him the majority stockholder. To protect himself, Artie has Homer take the blame. Homer's taken into SEC custody, and placed on trial.
When Homer is on trial (and naturally makes a fool of himself after failing to understand the Fifth Amendment), Marge blames Artie for Homer being put on trial and further adds that his self-centeredness is the main reason nobody likes him. Homer is eventually found guilty and sentenced to ten years in prison. Marge kicks Artie out of the house and tells him she never wants to see him ever again. Visiting Moe's Tavern, Artie encounters Patty and Selma, and Selma comes to take Artie to her apartment after he mentions putting Homer in prison. As they spend the night together, Artie makes a plan to turn over his corporate books in order to admit he is the real crook. Ziff turns himself in, and Homer is released from prison. The family takes one last look at their "Uncle Artie," who is using a squirt bottle to put out the prisoners' cigarettes, much to their anger.