I have been saying since the revelation of Rhaegar and Lyanna's official marriage on Game of Thrones that this would be the thing that turned Varys around from supporting Daenerys. For one thing, it is simply too hard to believe Varys hadn't known about Rhaegar's second marriage or the child on the way. It would explain Ned's desperate need never to say anything that might give Jon away if he feared Varys' "little birds." As far as I've been concerned, it was only a matter of time once Varys learned Jon's real name for him to change loyalties. Again. But will Varys' betray Daenerys? Warning: Spoilers for Game of Thrones Season 8 follow.
To be fair, Daenerys knew this was coming the moment Jon told her the truth in the crypt. She said to him if he told anyone that it would get out. Once it was out, the changeover would begin. It doesn't matter what Jon Snow wants because Jon Snow isn't a game player. He's a piece on the board — one that Sansa, Tyrion, and Varys will use. The moment he told Sansa, it was over.
Jon insisted this wasn't true. He even made Sansa promise not to tell anyone. That lasted all of a day before she told Tyrion and Tyrion told Varys.
Varys is loyal to "the Realm." It's his excuse, in a way, for how fast he flips sides when sides need flipping. Daenerys recognized early on that though Varys had come all the way to Meereen to find her, that didn't mean he would stay loyal. It just meant she was the best option at the moment. Varys would change again as soon as he found a better one. And that better one would almost certainly, as Tyrion noted, have a c*ck.
This was a terrible scene, but it was also an honest one. Game of Thrones has always been a story about the patriarchy and how it ruins everything. The patriarchy is why Robert Baratheon could start a war over Lyanna Stark even though she married Rhaegal with her own free will. The patriarchy is why Sansa would believe siding with Joffrey's family over her own was the right move in King's Landing. The patriarchy is what characters like Brienne and Olenna Tyrell have been fighting their whole lives.
It's a problem. It's a problem that Daenerys identified at Winterfell as Tormund shouted about how Jon was so crazy for riding a dragon, something she's been doing for years, as if she wasn't even there. The people of Westeros don't want a queen, be it a Lannister or a Targaryen. They want a king. And Varys just found them one. As he put it to Tyrion, this was no longer a secret. It was information.
It doesn't help that Daenerys is acting like a despot. As Tyrion argued, it was understandable Daenerys believed herself to have a divine right to rule. Walking into the fire and then out again with three dragons will inflate the ego a touch. As Daenerys goes off the rails, it's easy to understand why Varys has already decided there are better options out there to switch his allegiance to. We'll see how this goes in the last two episodes of Game of Thrones.