The idea of Varys being a spy for Cersei is absurd. He has no motivation. Varys might indeed come to the conclusion that Dany is a terrible ruler (which ultimately makes Varys an idiot for throwing all his weight behind someone he barely knew). However, if her cruelty and poor decision making bother him so much, why would he support Cersei? Despite the many attempts of fans to reinterpret the character because they love the actress (and Lena Headey is awesome), Cersei is evil, incompetent, petty, and almost cartoonishly short sighted. Betraying Dany for a better ruler makes perfect sense, but Cersei ain't it.
I've seen this theory floating around everywhere, as a way to explain why Varys is seemingly ineffective lately and why Cersei's military is so strong. Ultimately, there are easier explanations for that. Jaime, Euron, and Randyll Tarly are without questions the best military minds in Westeros. She had them all on her side. Dany's best commanders were Barristan (dead), Jorah (MIA for a while), and Grey Worm. She just got Jorah back, and Grey Worm has been relying on the others because he knows nothing about the continent.
As for Varys, everything he does in the books leads to him putting Aegon on the throne. In the show, they change this to him wanting to put Viserys on the throne. That alone proves they have no idea what to do with Varys anymore. He'll go the way of Littlefinger. I think they knew he would die before the end, and decided to shove him to the side while they developed other characters.