After a high-speed freeway police chase (seen in Meet the Browns) results in Mabel "Madea" Simmons' arrest, she is placed in an anger management course, and admits her permanent license suspension. Returning home from court, Madea finds a party taking place in her house hosted by her brother, Joe Simmons, who is trying to cheer up Madea. However, Madea is not amused by the festivities and uses a machine gun to scare the party goers away.
Madea consults with Doctor Phil McGraw for anger management, but does not cooperate with McGraw. Returning home, Madea, needing to buy groceries, calls Cora to drive her to the store, but Cora declines, angering Madea. Joe predicts that Madea will get into trouble if she goes to the store, but Madea ignores him and goes anyway, driving in her car. At Kmart, a woman steals the parking space that Madea was about to take, so she commandeers a forklift truck to remove the woman's car from the space, wrecking the car in the process. Madea is arrested and brought to court again, where Judge Greg Mathis sentences her to prison for five to ten years.
Meanwhile, assistant district attorney Joshua Hardaway is on the fast track to career success. He is prosecuting a young prostitute and drug addict, Candace "Candy" Washington, with whom he is already acquainted. Josh asks his fiancée and fellow ADA Linda Davis to fill in on his behalf. But when Josh takes Candy out to eat and gives her his business card for future assistance, Linda gets jealous and fears Josh may be cheating on her. Although Josh tries to assure her that he is only trying to help a friend, Linda tells him that it was Candace's own fault for being who she is, and that he should only socialize with a higher class of people. Josh, however, keeps helping Candace anyway, to the point where he rescues her from a pimp and brings her to his home to spend the night. When Linda finds out, she gets furious and threatens to leave him unless he puts Candace out of his life for good. Conversely, Candace sees right through Linda and tells Josh that it will never work between them since they are too different; Linda is too classist and stuck-up to show sympathy for people who have a lower status than her, while he actually cares about helping anyone he sees in trouble.
Josh later meets Ellen, a former prostitute who has now become a minister. After Josh asks Ellen to help Candace, Ellen gets her a job interview, but it results in sexual harassment by the interviewer, who Candace kicks in the groin before storming out. Just before Madea's trial, Ellen asks Josh how he knows Candace. He tells Ellen that they were close friends from childhood through college, but all his friends mistreated and bullied Candace, and he started pushing her away out of embarrassment. He breaks down when he talks about one particular night when he took her to a party. He ended up going on a date and leaving Candace behind at the party, where a group of his friends gang raped her in his absence, for which Josh continues to harbor deep-seated guilt. Ellen comforts him and tells him that he should not continue holding on to the guilt and that it was not completely his fault, since Candace already had personal troubles beforehand.
At the district attorney's office, Josh's best friend, Chuck, runs into Linda and discovers that she is falsifying Candace's file to deliberately get her sent to prison and away from Josh, a practice she has been engaged with other defendants as well, including Madea. Linda blackmails him to keep his mouth shut under the threat of telling the head A.D.A. that Chuck cheated on his bar exam to get his job. Candace refuses to show up to her case and returns to prostitution, until she is arrested by an undercover policeman. Due to Linda's falsifying of her file, the judge gives her a seventeen-year prison sentence. Linda later lies to Josh back at the office and tells him that she "tried" to be lenient. Chuck overhears this and nearly tells Josh the truth, but hesitates because of Linda's previous threat towards him.
When Candace ends up in prison, she discovers that Donna, one of her best friends who has also been arrested for prostitution, is also there. Madea is shocked when she meets her cellmate, a seemingly insane serial killer named T.T., who is serving a life sentence for murdering 18 men.
While in prison, Madea befriends Candace, and comes to her defense when she is sexually harassed by Big Sal. Candace, Madea, T.T., and Donna attend a class taught by Ellen at the prison, in order to have time reduced from their sentences. During a lesson about forgiveness, Madea notices that some of the inmates would rather play victim instead of taking the blame for their crimes. She tells the class they need to stop seeing themselves as victims and forgive those who led them on the bad paths they've been on, as they weren't the ones who ended up in jail. Candace is moved by her words, and during a visit with Josh, she admits that back when she was raped at the party he took her to, she called his name repeatedly as the attack happened, but he never came for her. Candace held on to her anger at him for so long, she forgot how to move on, which resulted in her dropping out of school and becoming a drug addict and prostitute. But with everything she learned from Ellen and Madea, she finally decides to forgive Josh and pick up the pieces of her life.
On Josh's wedding day, Chuck, serving as best man, finally tells him that Linda falsified Candace's file. During the ceremony, Josh, disgusted by Linda's deceit, tells the congregation, including his and Linda's boss, what Linda has done, and jilts her at the altar. Josh then rushes to the prison where he admits to Candace that he loves her and will help her get out of jail and restore her life. Because of the now-revealed news of Linda's tampering with client files, there is a public outcry and a protest movement gains momentum to set Madea, Candace, and the others free. In the end, Candace, Madea, and five other women that Linda prosecuted have their convictions overturned and are released, while Linda inevitably faces arrest, prosecution, and imprisonment on multiple charges including fraud, evidence tampering and providing false legal documents. The film ends with Candace and Josh, now a couple, walking out of the prison and sharing a kiss in front of the press.
The film received mixed reviews from critics. Rotten Tomatoes gives the film a score of 30% based on 50 reviews, with an average score of 4.9/10. The consensus says, "Divided between sincere melodrama and populist comedy, Madea Goes to Jail fails to provide enough laughs – or screen time – for its titular heroine." Another review aggretator, Metacritic, gives the film a score of 50%, based on 13 reviews.
Sam Adams of the Chicago Tribune gave the film 2.5/4 stars and wrote that "if the movie is a mess, it's a purposeful mess, cannily, if not artfully, pushing all the right buttons to ensure Perry will be back for another round."
According to a New York Times review, the film gives Madea herself a much more central role than some of the previous Madea movies, in some of which she is merely a commentator on events.
The Boston Globe reported that "(Madea's) character epitomizes Perry's ongoing commitment to dramatizing as many rungs on the ladder of the black experience as he can. His aim never produces a completely satisfying or consistently competent-looking movie (his heart's in the right place, if not his camerawork)."
On its opening weekend, the film opened at #1, and grossed $41,030,947 (2,032 theaters, $20,192 average), the biggest Friday to Sunday take since Twilight in November 2008. It broke Madea's Family Reunion weekend gross at $30 million as the highest weekend gross for a Tyler Perry film. It broke Saw III's record at $33 million for the highest weekend gross for Lionsgate Entertainment. "We were cautiously optimistic we could do 30-plus," Steve Rothenberg said. On its second weekend, it dropped 61 percent, but remained at #1 grossing another $16,175,926 (2,052 theaters, $7,883 average), bringing the 10-day gross to $64,525,548. The film closed on April 23, 2009 with a final domestic gross of $90,508,336.
An exclusive preview was included on the cinematic release of Tyler Perry's The Family That Preys.
Madea Goes to Jail was released on June 16, 2009 on DVD. According to DVDTown, the DVD included six behind-the-scenes featurettes. As of July 12, 2009, 1,125,422 DVD units have been sold, gathering revenue of $18,223,621. A Blu-ray version was released on November 23, 2010.