The action of eating one’s own feces is called coprophagia, a practice common in young dogs and puppies.
One possibility is that your dog isn’t absorbing enough nutrients in its diet. This doesn’t necessarily mean they have a poor diet. Instead, something is getting in the way of their nutrient absorption processes.
Another possibility is that your dog is practicing coprophagia for behavioral reasons rather than medical ones. They simply do it out of curiosity or as a form of playing.
One of the easiest ways to stop your dog from eating poop is to make sure they never get the opportunity to do it in the first place.