Most animals need sleep, but we do not know why.
Sleep patterns in humans are culturally-established. Some cultures have their siesta, for example. Many American males like their weekend naps.
European families, and many American families up until the early 20th Century, often shared beds unless they were prosperous. In the old days, Europeans had two sleeps - a first and a second. Two sleeps with sex or prayer, or both, in between. Both sounds good to me.