He might be lacking something in his diet. I would see a vet and figure out what it is.
This rather antisocial habit is called coprophagia and unfortunately some dogs just can’t get enough of it! There are a few theories as to why dogs may develop a taste for faeces but mostly it seems to be a habit that is difficult to break. Visit your vet and rule out any underlying causes such as exocrine pancreatic insufficiently. The internet contains many home remedies to treat coprophagia but beware as some include toxic ingredients. I have found adding pineapple juice to food deters some dogs but mostly, they just refuse to give up the habit! In persistent cases, cleaning up immediately after your dog goes to the toilet and avoiding off lead walking is the best way to prevent reoffending. Make sure intestinal worming is up to date to ensure that your dog remains worm free despite the occasional slip up!