What compels humans and animals to have fun?

In that case - animals don’t have fun, as the survival-linked benefits from their “fun” - group cohesion, safe hunting practice and skills training - are not “wasted effort” and are obvious.