In chapter seven, Stanley Yelnats digs his first hole, which is supposed to measure five feet deep and five feet across. Well before Stanley finishes digging his hole, the other boys finish their work, and Stanley proceeds to watch each boy spit in their own hole before heading back to camp.
There are several explanations as to why the boys engage in this rather odd daily ritual. By spitting in their holes, the boys express their disdain for the arduous, pointless labor. Their spit is also a sign of contempt for the entire administration and facility at Camp Green Lake.
In addition to expressing their disdain for the difficult work and uncomfortable camp, the boys more than likely have excess saliva from lack of hydration, and spitting is a relieving feeling. Overall, the act of spitting in one's hole is a refreshing feeling to the boys, which also happens to express their contempt for their unfortunate situation and difficult work.