Tails enable expressive non-verbal communication and can help animals stay clean by keeping flies away, but these uses don't feel like good enough reasons for natural selection given that animals can do these things without tails. And worse, tails make prey easier to spot and catch, especially when they aren't strong enough to lift any body weight (i.e. non-prehensile tails).
But, tails have functional value in helping animals balance themselves in the same way that tightrope walkers use a pole to help keep their center of mass directly above the wire by increasing their moment of inertia.
I'm excited to see more robots with tails. In theory, they should be able to balance better when jumping through the air (course correcting mid-flight), making tight turns, and responding to dynamic disturbances. Hopefully, this agility will make robots feel less like machines.