To sense if the territory belongs to other dogs. Dogs have a strong sense of smell. So, when they are about to poop, they smell the area to learn about other dogs in the neighborhood.  Through sniffing, they get an idea about whose area they are in, and once they are done doing their business, they kick their feet to cover the poop to let the neighborhood dogs know about their presence.