When Hamlet asks this question, he's essentially asking if it is better to be alive or dead. Is it easier to put up with everything life throws at us or resign oneself to death? In Hamlet's mind, death does, theoretically, end the heartache that results from life's harsh treatment. When other characters are forced to grapple with this question, most seem to choose "to be," or live instead of die. However, Hamlet claims, "I do not set my life at a pin's fee," when he is about to meet his father's ghost (1.4.73). He means that he hardly values his own life; in fact, he values it less than he values a pin. Hamlet seems prepared to embrace the idea of death.
Further, Ophelia seems to eventually choose death over the pain of life. She is driven mad by being forced to spurn Hamlet, the man she loves, then by his ensuing madness (which she believes to be sincere), and his murder of her father. When she falls into the water, Gertrude describes her "As one incapable of her own distress" (4.7.203). Perhaps it is simply that Ophelia is not distressed because she has no more reason to live, and, with nothing left to live for, she accepts her impending death in the water.
No one else in the play wants to die (or be dead) though. Hamlet's father is clearly angry that his life was taken away: he is most angry that he was taken "in the blossoms of [his] sin, / Unhouseled, disappointed, unaneled, / [...] but sent to my account / With all [his] imperfections on [his] head" (1.5.83-86). Old King Hamlet is angry, certainly, that he was cut down in his prime even before he could make confession.
Claudius and Gertrude have no desire to die; they seem to want to live on and enjoy their lives together (until Hamlet confronts his mother, at least). She is very distressed to realize that her husband poisoned the cup meant for Hamlet from which she drinks. She says, "O, my dear Hamlet! / The drink, the drink! I am poisoned" (5.2.340-341). These are not the cries of a person happy to die. Claudius, likewise, wants to live. When Hamlet wounds him, he begs, "O, yet defend me, friends! I am but hurt" (5.2.355). He asks for assistance to sustain his life, though it does not come.