After having a litter of babies, a mother dog will eat the puppies' feces.
It is instinct that causes her to do this.
Out in the wild, she needed to hide the scent of her puppies from predators.
By eating the poop, she would cut down on the smell, which might have attracted animals that would kill the babies.