I've always believed that they bite and eat to spread the virus in them, like others have stated. The virus wants to spread, so it creates a need in the zombies to eat, but since they are slow (usually, fast zombies are just silly to me) that gives the victims a better chance to get away after they have been bit, but of course they will eventually turn, and attempt to transfer the virus all over again. Zombies do not eat themselves because they are dead, and the virus does not want to spread to dead things, so dead things are unappetizing (go figure).
I think there are 2 types of zombies however, and in order to argue their behavior, you must define what sort they are first. The first type is a truly dead thing, that has died, and then comes back to be a zombie. Perhaps the brain is reanimated in some way, like in The Walking Dead, where just the primal brain stem is reactivated by the virus, and they go around, stumbling, decomposing, and eating humans.
The second type is a human who's been infected with the virus that takes over the brain, not killing the human, but turning them into a zombie (in a sense, can you be a zombie if you have not died?) who wants to eat people, possibly because the virus wants to spread. This is sort of like the movie I Am Legend, where the humans have been infected, changed in some way, but have never died. Their bodily functions work, everything works, they are not deteriorating, they are living, but they crave flesh, brains, humans, what-have you, and can't be rationalized with in any way. However, then that would mean that if you cut their leg off, they would eventually die of blood loss, and then the iconic "destroy the brain" would go out the window, and that would be no fun.
That's just my opinion however. Much like steampunk, zombies in movies and books are not based on any one real thing, and therefor are subject to all sorts of crazy rules and ideas, so they are always fluid and changing, which I think is great (keeps one on their toes).