Before I go ahead, customary caution, this article contains spoilers.
Now, moving on, RIP Lord Varys, the only true protector of the realm. No, he was not wrong. And he definitely did not deserve the end he got.
True, right from the start, we knew that Varys may not live to see the finale of the series. And by the beginning of season 7, we began to hope, until the Red Woman foretold Varys' fate. Also, notice how she prophesied it in Dragonstone, at the same place where Varys was finally executed.
Yet, in all fairness, he deserved to go out like the warrior he is; albeit not on the battlefield. Never once did his faith in the people falter. And never once did his loyalties change.
Right from season 1, Varys remained true to his loyalties which lay solely with the people of the Seven Kingdoms. After being held captive in Baelor, when Ned Stark asks him who he truly serves, he makes it evidently clear.
He was the silent strength that helped bring about the tidal change through the 8 seasons; even if he was not one of the lead characters. He made it evidently clear to Ned Stark and remained consistent till the very end.
Had it not been for Varys, Daenerys would never have realised her destiny.
Had it not been for Varys, Tyrion would have died at the hands of the Mountain in King's Landing after his trial.
Had it not been for Varys, Daenerys and Tyrion would never have met and Cersei would have remained the unopposed tyrannical ruler for God knows how long.
Sides changed, people changed and so did their loyalties oscillate. But, not Varys. He was probably the only character who ever thought of the people and not the Iron Throne. And if he did, it was always for the good of the people.
He even confronted Daenerys in Season 7 when she asked him about his loyalties and why she should trust him.
And in turn, she asked him to tell her if he ever thought she was failing the people. And that's exactly what he did.
In the end, yes, we do see Varys worried about Daenerys mental stability. We also see him stand up to her when she wants to wreak havoc on King's Landing after Missandei's capture. But, Varys did keep to his word. It was Daenerys who ignored it.
Over time, Varys became a force to reckon with. And let's face it, whichever side he chose to be on ended up being the stronger side - simply because his cause was greater than the cause of any ruler, tyrant, usurper, or heir.
Even in episode 4, Varys time and again reiterated the truth to Tyrion - who ironically even agreed with him - knowing fairly well that it could be carried vack to Daenerys.
To whom Varys addressed his last letter remains unknown - but, maybe not for long - as does the matter of whether or not, he sent it; but, knowing Varys, he probably knew his end was near. And that he would be dying at the hands of the very Queen he chose to stand by. He probably even made arrangements that the letter be delivered to whoever it was addressed to.
Nevertheless, he did not deserve to go gentle into the night. He deserved a fair trial. He deserved an audience. He deserved the loyalty he exhibited to the realm.
What Varys did was not betrayal; it was merely keeping a longstanding promise. What was done to him by Tyrion and Daenerys was betrayal and injustice.
It was an injustice to his character and a surefire sign that the 'rightful' queen lost her biggest and most important pillar of support.
He did not deserve to go gentle into the dark of the night on a beach in Dragonstone, with Drogon - who even as a dragon, for a second, sensed Varys was one of their own - incinerating him. He deserved to rage against the dying tide - the metaphor really is rather uncanny in this one - with a fair chance at reason with the Queen he once believed in and who owe her life and her destiny to him.
Varys is easily one of the few handpicked characters whose deaths affected fans; especially because of the way The Spider had evolved through seasons.