That is because refraining from sleep is the test to prove that a person can be immortal or just a mortal.
Utnapishtim had offered Gilgamesh an opportunity for him to have eternal life. That is a chance at immortality. But the condition that he needed to fulfill is that he would not sleep for six days and for seven nights. Immediately the condition is fulfilled then he would become immortal.
He agrees to these terms but sleeps off immediately he sits down. He ended up sleeping for the entire duration that he was to stay awake.
More questions from this story at
https://brainly.com/question/16553774?referrer=searchResults
https://brainly.com/question/15699661?referrer=searchResults