To answer your question, it was not necessary for Gatsby to die in a sense. He was not a criminal and his death did not bring with it a sense of "justice" served on a character that deserved it. Honestly, the choice of the author to use this ending was more geared towards an emotional response to the reader rather than an ethical one. It seems unlikely that the story should have ended in an unsatisfying way for him in terms of not being able to have the one thing that he spent most of the novel searching for. As we began to see past the spectacle of the Great Gatsby and learn who he really was beneath the surface, a desire developed in all of his to see him have a happy ending for once. And though this was not what he got ultimately, F. Scott Fitzgerald made the choice to free us of the tension that we all felt and close the door on Jay Gatsby in a way that was more pleasing than him being alive and unfulfilled.