Suicide was a common theme in Romantic works, and I think Tchaikovsky's own complex personal life partly inspired the ending. As it's been performed over the years ending has been changed depending on the attitude of the ballet director.