Swallowing dirt may cause constipation and intestinal obstruction, which results in stomach pain.
Callahan GN. Eating dirt. Emerg Infect Dis. 2003;9(8):1016-1021.
Davis S, Mirick DK. Soil ingestion in children and adults in the same family. J Expo Sci Environ Epidemiol. 2006;16(1):63-75.