A lot of people want to attribute human cognitive functions to doggie behavior, but the truth is they are dogs. They don’t do things for logical reasons, as we humans like to pretend we do.
One theory is that dogs eat grass to make up for a deficiency in their diet. Carnivores in the wild ate the intestines of animals that ate various grasses. But is the diet of the modern dog also deficient in cookie crumbs, pizza crust and cat poo? Dogs will also eat chicken bones and chocolate which can be deadly for them.
We once had a dog who loved lettuce and many vegetables. We fed raw vegetables to her along with her regular dog food every day of her long life. She still tried to eat grass on occasion whenever she found some nice long blades.
Since dogs often vomit the grass back on the carpet, making a slimy green mess, the theory that their bodies need nutrition from grass seems a little weak.
Eating grass does not harm the dog.
Making him stop does not cause any damage to his psyche or digestive system but it’s a lot easier on the carpet.