The idea that animals are biological machines with a multitude of pre-programmed responses to different situations is an old and in my opinion very silly idea, it really makes no sense once you think about it. I don't know why its taken so long to start falling out of favor (Edit: That's actually a lie, I've got a fair idea

).
Sure, there are some higher order emotions that only make sense in a social context, which some animals might lack, but the basics are surely almost universal in at least mammals and birds (and quite possibly go even further back).
Emotions are a neat and simple way for evolution to 'get the job done', without a bunch of very complicated pre-programing. It is also a much more flexible and adaptable way of doing it.
Make a parent bird/animal love and care about their kids and they will do their best to raise them properly and protect them from harm. Evolution would quickly get stuck if it had to pre-program a response for every eventuality.
When an animal is in need of sustenance evolution makes them want to go to all the trouble of looking for and finding food, by making them feel hungry, I don't think too many would dispute this. The same goes for reproduction, pre-programming, not necessary, just make 'em horny, real horny

. As soon as love, anger, depression etc is mentioned, pertaining to animals, there seems to be some disconnect/denial, dunno why (Edit: Another one, I've got a fair idea).
I've seen many animals/birds get p'd-off and angry, throw a temper tantrum, or depressed when losing a friend. Sometimes it is clearly counterproductive in a supposed 'pre-programmed by evolution' sense. You definitely don't have to be intelligent to really feel hungry or angry or love or horny.
What
would be a great mystery, would be if evolution did things completely differently for animals and then suddenly emotions popped up in the human animal (and all that supposed pre-programming suddenly disappeared), makes no sense.