Stanley Yelnats, who has been unjustly accused of stealing a pair of sneakers, arrives at Camp Green Lake, a juvenile detention center in the middle of a vast desert. The camp is run by a tyrannical woman named Warden Walker and is home to a group of misfit boys who are forced to dig holes every day as a form of punishment. Stanley befriends a group of the boys, including Zero, a mysterious boy who doesn't speak.
As the boys dig their holes, they learn more about Camp Green Lake and its dark history. Many years ago, a man named Stanley Yelnats Sr., who was Stanley's great-grandfather, was framed for a crime he didn't commit and was sent to Camp Green Lake. Yelnats Sr. managed to escape from the camp, but he was never able to clear his name.
One day, Stanley and Zero discover an old treasure chest while digging their holes. The treasure chest contains a map and a set of instructions that lead them to a hidden cache of gold. The boys decide to follow the map and find the gold, so they can prove Stanley's innocence and help Zero find a new home.
The boys encounter several obstacles along their journey, including Warden Walker and her guards, as well as a group of menacing coyotes. However, they are able to overcome these challenges and eventually find the gold. They use the gold to clear Stanley's name and help Zero find a new home.
In the end, Stanley and Zero are reunited with their families and they both start new lives. Stanley learns that it is important to be honest and to stand up for what is right, even when it is difficult.