A Google search reveals:
Stanley Coren, a professor of psychology at the University of British Columbia in Canada and the author of The Intelligence of Dogs and How to Speak Dog said domestic dogs are descended from wild canines and still display many of the behaviors of their ancestors. The wild relatives of domestic dogs--wolves, foxes, coyotes, and dingoes--all display the same circling pattern.
Wild canines turn in circles, said Coren, to trample down the grass and make it more comfortable to lie on. They also turn in circles on soil to break the surface of the soil, making it softer and more likely to conform to their bodies. Coren said that domestic dogs are most likely to exhibit the same circling behavior when lying down on grass, though they also turn in circles on a carpeted floor, which feels a bit like grass against their feet.