Friendships are adaptive for animals, and they probably feel good, thanks to oxytocin. That's the gist of this article from Science News. I've certainly seen dogs who were best friends, and, of course, with animals in the wild, especially monkeys, those who cooperate in childcare and food-sharing are likely to survive longer and rear more offspring.
The article summarizes several research projects that try to correlate oxytocin to "friendly" behaviors.
With all the research on the effects of oxytocin in humans, this seems like an example of science working its way backwards from people to monkeys. But I am always happy to see science that helps illuminate that animals have emotions like we do.