Some of the possible reasons are ------
1. Scent marking
Circling and pooping may be a way for dogs to communicate with other dogs through scent marking.
This is one of the ways canines silently exchange information about their health, territory and presence.
2. Preparing the area
Circling may help dogs to find the right spot to poop, taking into factors like texture, smell and visibility.
3. Instinctual heritage
Circling before pooping is an instinctual behavior from wild ancestors, who needed to prepare a safe and suitable area to defecation and to ensure the area is clear of threats, insects and obstacles.