This is a very common things dogs will do. It is called coprophagia. There's no real reason why they do it but there are some things that help discourage the behavior
1...the obvious..pick up the feces more often and they will get out of the habit.
2. try changing dog foods. Some think foods higher in fat contnet will make the feces more palatable...do this gradually so not to cause gastric upset.
3. Mix a product called "Forbid" with the food and this will make the feces taste bad...(yeah I know, you would think it already tastes bad huh?) You can get this product from your vet.
Let me know if you have any other questions
Good Luck &
Best Fishes