Evolution is supposed to be purely accidental but at the same time people like this speak as if evolution is a living entity. They deny a creator but insist that evolution can plan things and make mistakes. One of their constant refrains is that animals "experiment" with certain aspects of physical change, such as flight, indicating that they believe evolution actually has a brain and can set up certain species with experiments before the final change over to another species is made.
As for sleep serving some "critical" function, how about the fact it repairs the damage done to our bodies during waking periods, you know, replacing cells renewing our energy, I guess that isn't a critical function. The reason rats die in 5 days without sleep is because their bodies wear out without the needed sleep to repair the damage. What morons we have running the planet in these times.
You are correct on both points, evolution and body function. Evolutionists accept their belief even in the face of counterevidence such as here.
Growth hormone is produced when we attain delta sleep. Babies produce this hormone as they sleep and adults replenish their dead cells as they sleep. Sleep really is the process of renewal.