Of course he deserves to die lol, its not a question.
He has ruined so many people's life ; Naruto's, Sasuke's, Itachi's and god knows there is many more....
Although ill say this.... it also depends on what his true motive is....
Was he doing all of this so that he would end up seeing Rin in the next world
or
was he actualy ready to give his own life to Rinne Tensei Madara and thus killing himself in the process?
If he was doing all this to see Rin, thus not accepting to die for it, then he deserves to die for being completly selfish as one's goal / wishes doesnt justify the death of countless people
If he was ready to give his life for it because he believed that the next world would be a way to avoid pain truly for everybody and not only himself then is it to some extent showing that he was doing it for the greater good and not for himself .... ; It doesnt excuse his way of doing this but it's a lot less ''dramatic'' as he truly wanted to save people from this world of agony.
But giving the way he is currently thinking of Rin when facing death... it seems that he was not planning to die in anyways, and he himself said that he would become the Jinchuriki of the Juubi so he did counted himself to be part of the Mooneye plan in the end.
He does deserve to die for doing it for selfish reasons... but i dont feel that he is evil at heart.... he is blinded and innocent, but facing death will quite possibly wake him up and make him realise that the real world is the only world and that death is part of it, thus doing something to prevent Madara's plan.