answered
My friend had a dog that did that and the vet said it could be a couple of things, 1- it could be lacking something in its diet or 2nd- while potty training, you or whoever trained the dog may have shamed the dog so it eats its poop as to not get scolded.