There's a plausible hypothesis that sleep is the thing that evolved precisely to stop us doing things for any more time than is strictly necessary. That is, sleeping is safe.
That is, though sleep might have physiological requirements, it doesn't mean that the amount of sleep is not influenced by non physiological effects.
I'm constantly amazed by the ability of biologists to be amazed by the reach and ingenuity of evolution.