One reason dogs turn around before lying down to sleep is because that's what instinctively feels right. Ancestral wolves traveled in packs for a number of reasons. Perhaps dogs turn around today because the practice has become ingrained after thousands of years. When wild packs of dogs turn around before lying down in the wild, they may be establishing their territory and orienting themselves within the circle.
Another reason some experts believe dogs turn around is to trample down the area for comfort. A pack of wild dogs may decide to bed down on a grassy field, for instance, so the individual dogs turn around three times to force the tall grasses down. Any other hazards or obstructions may also be uncovered when dogs turn around three times. This trampling behavior is often observed in domesticated dogs who use padded dog beds, or sleep outdoors routinely.