Our world is full of rhythms. Rhythm of day and night. Rhythm of tides. Rhythm of the seasons. Waves.
So - animals also have internal rhythms. Heart beat. Walking. The different rhythms of various gaits of animals. Circadian rhythm. Beating of cilia in microscopic organisms.
Plants also have rhythms too.
So what counts as "keeping a rhythm" in an animal? Perhaps vocalisation, or body actions that are "leisure activities" not directly connected to survival as e.g. walking is or the heart beat?
If so then rhythm in the human sense of e.g. recognisable pattern of say 4 beats to a measure or 3 beats to a measure seems to be an especially human trait. Also ability of humans to synchronise with each other while playing music.
Some bird song may repeat in cycles, and anything which repeats in a cycle has a sound of rhythm to a human - but whether it really counts as rhythm I don't know - it might just be that the bird is repeating it like a recording in a loop. Similarly a woodpecker drumming - is that keeping a beat or is it just a repeating cycle, behaviour in a loop?
Some birds and animals can keep time with human generated music. Particularly, primates, elephants and parrots. Example, Snowball the dancing cockatoo:
http://www.scienceline.org/2010/02/they-got-the-beat/
I expect it has some survival value as it helps us to learn to cooperate and to work with each other. In many cultures people sing as they work and the singing helps with the rhythm of the work, also makes it pass more quickly and enjoyably and as a result you get more work done or do it better.
Though not everything we do has to have survival value. Evolution may lead to a creature with sense of curiosity, play, fun, sympathy etc and though in general taken as a whole, all those things probably have survival value for the species and on average for individuals within it, as we well know many things we do as individuals don't seem particularly oriented towards survival. I.e. survival of the fittest may have at least partly shaped our bodies and emotions - giving us bodes and ways of working with the world which make it on the whole easy for us to survive in our ecological niches. But survival doesn't need to motivate us as individuals, as we well know. E.g. thrill seekers, or altruistic people to give examples.
Same for animals, though fitted to survive, doesn't mean that everything they do is of survival value.
So - though it may well be of survival value, music doesn't have to have survival value to occur.