“Death is one of the few things that can be done as easily lying down. The difference between sex and death is that with death you can do it alone and no one is going to make fun of you.”
The idea behind the quotation
The joke is that death, like sex, can happen while lying down, but unlike sex, it can be done alone without anyone laughing at you.