A dog makes circles before he poops for his hygiene.
If a dog was ever in a grassy field, he would circle to make sure all the other dogs knew where his prized message lay.
This also helps in marking his territory.
Another reason Fido might spin around a few times is to check the area for threats, like predators.