The technical term for this behavior is coprophagia. While it is most often a behavioral problem, owners must rule out medical causes first. If there is some reason that a puppy or dog is not absorbing the nutrients properly from their food or they are experiencing nutritional deficits such as missing vitamins or minerals, parasites, or they simply are not being fed enough, can all result in coprophagia. If your veterinarian has examined your dog's diet, run a stool sample for parasites, etc. then you can definitively say your dog has a behavior problem and you can seek out a solution with that in mind.
Coprophagia is quite common in puppies and may simply be a byproduct of them being left unsupervised long enough to explore and consume feces. There is definitely observational learning that goes on with this behavior, meaning if you have another dog who does it, it is likely that your new puppy will do it too, just from seeing the adult dog engage in the behavior. I've even seen owners use the old fashioned correction technique with their puppies where they take them to fecal accidents in the house and shove the pup's nose toward it. This can certainly make a puppy want to eat the feces to make it go away since you've drawn so much attention to it! And finally, some adult dogs who have groomed and cared for puppies, just inherently want to clean up feces when they find it. Feces from other species of animals, including the family cat, are attractive to dogs because they smell different and are often texturally different as well.
Treatment for coprophagia requires vigilance and no one method works for every dog. First and foremost, owners must be vigilant about keeping their yards free of feces. Cleaning up immediately after defecation is key. Keep the dog on leash so that as soon as they go, you can lead them away, give them a treat, and then go pick it up. On walks, keep your dog away from areas where other animals toilet regularly, particularly if you live in an area where your neighbors aren't picking up behind their dogs. Clean the cat box regularly and place the box in an area easily accessed by your cat, but not by the dog.
There are a couple of products (CoproBan and For-Bid) you can buy through your veterinarian that when sprinkled on your dog's food will not change the taste of the food, but will change the taste of their poop! Likewise, canned pumpkin, some pineapple juice or canned pineapple, or even a meat tenderizer such as Accent can be put on their food and change the way their feces tastes. Just be careful if using canned pineapple as you don't want to use too much as the sugar can give your dog diarrhea. Many dogs, however, are not deterred by any of these food additives and will continue to eat feces.
The bottom line is this: Try it all, but know that the best treatment involves avoidance. Keep your yard spotless. Keep your puppy or dog on leash. Call or pull them away after defecation and give them a high value treat for moving away from the poop. Over time, many puppies grow out of the behavior, but for adult dogs it may persist. They won't do it at home where you keep everything clean, but they will go looking for feces on walks. Keep to the sidewalks, always keep them on leash, and teach the "drop it" or "leave it"command so you can reward them for dropping the feces they find or walking away from it.
As always, if you need my help, let me know!
Laverne, the Labrador puppy, keeping busy so she doesn't eat poop!