In order for Beowulf to be the man of legend that he is, he must die. What makes Beowulf the brave, heroic man of legend is that he is willing to die in order to vanquish evil from the world. That's why Beowulf is the central figure and the man that lives on in legend. For example, the text says that Unferth was less worthy than Beowulf, because he wasn't willing to risk his life and die.
[Unferth] was not man enough/ to face the turmoil of a fight under water/ and the risk to his life. So there he lost/ his fame and repute.
Beowulf needs to die in order to become a legend that lives on forever in the minds of men.
If Beowulf had lived, he would still be a great man; however, he wouldn't be a legend. He would be a hero for sure, but not a legend or legendary hero.