In my humble opinion every animal consistent of multiple cells alive on this planet developed sleep for just one reason: the very same reason plants sleep. Our planet has a night phase and without sun little energy is left. So as a consequence the best one can do is to clean up internal processes or go into some sort of energy saving mode. Ofc this is heretic to some individuals...
But Ockham's razor tells me I'm right.