"Grateful Dead: in folktales of many cultures, the spirit of a deceased person who bestows benefits on the one responsible for his burial. In the prototypical story, the protagonist is a traveler who encounters the corpse of a debtor, to whom the honour of proper burial has been denied. After the traveler satisfies the debt, or, in some versions, pays for the burial, he goes on his way. In another version of the story, burial is prescribed for religious reasons but prohibited by civil authorities. It is this version that forms the theme of the apocryphal Book of Tobit in the Old Testament. The hero is soon joined by another traveler (sometimes in the form of an animal, or, in the story of Tobit, an angel), who helps him in a dramatic way. In some stories the companion saves the hero's life; in others he helps him gain a prize. In many versions, the companion offers to aid the hero, but only on condition that they divide the prize. Then, as the hero is about to comply, the companion reveals himself as the grateful spirit of the deceased whom the hero helped to bury." This where they got their name?
That's one of many tales, no one will know for sure where it came from. One thinh is for sure, they didn't choose the name Grateful Dead, the name Grateful Dead chose them.