Alternately, sleep is the optimal ultra-high-efficiency survival state and wakefulness only exists to give creatures enough time to get their affairs in order so that they can safely return to dormancy.
It's easy to think of sleep as a compromise to be defeated because we're culturally preoccupied with the achievements and pleasures of wakefulness, but that's really just us claiming personal preference for one narrow part of a holistic system that's just doing its own survival and propagation thing.
Consider trees, mushrooms, cicadas, snakes, or cats. Chilling out in low power mode as much is possible is maybe not a error to be fixed so much as it is an outcome of efficient design.