The quotation appears to be in a line of death-longing ideas that include the famous "To be or not to be" speech in Hamlet. Briefly, these ideas focus on the difficulties of being alive: injustice, heart ache, disease, sin - the "fardels" or burdens referred to by Hamlet in that speech. These thinkers therefore think that being alive is difficult, troublesome, painful and therefore a "curse".
Logically, if life is a "curse", the cure for that curse is death. The Jonson sonnet On My First Sonne expresses this as he considers his own son's untimely death and says "Will man lament the state he should envy? To have so soon 'scaped world's and flesh's rage, And, if no other misery, yet age?" asking why men are sad at death when they should envy the dead for having escaped the horror of being alive.
Sleep and Death are very similar states: both involve unconsciousness, lack of awareness or responsiveness to the world. They are so similar that Hypnos and Thanatos, Greek personifications of Sleep and Death respectively, were not simply brothers but twin brothers. Sleep is seen therefore almost as a temporary form of Death. As such, therefore, sleep is a temporary "cure" for the curse of being alive and sensible of the world, like having cancer but it being in "remission". Returning to Hamlet briefly, it is not accidental that Hamlet speaks of "To die, To sleep / To sleep perchance to dream". He, however, continues to state that fear of the dreams that may come in death prevent people from embracing it.
Hope some of this helps.