The walkers are dead, they do not need to eat nor do their intestines work. If you are going to accept that living-dead zombies are possible you have to suspend your disbelief.
That said, there are some analogues to the real world with parasites. The closest one that I can think of is this one:
Instead, the microorganism is somehow able to recognize the brains of different ant species, and releases its mind-controlling chemical cocktail only when in its preferred host, new research shows.
"Behavioral manipulation is such a complex [characteristic] that it only occurs when there's a very close coevolution between pathogen and host," said Charissa de Bekker, a molecular biologist at Pennsylvania State University and lead author of the new study, published in August in the journal BMC Evolutionary Biology.
In the first season, Rick and the gang travel to the CDC and it's discovered that everyone has this virus. So, theoretically, the virus could be making the zombies bite/attack the living in an effort to spread itself. Of course this wouldn't be an intelligent process, but rather through natural selection it's what 'worked'.