Varys is a consequentialist and a utilitarian, but he’s not a Targaryen loyalist in the normal sense – he thinks that the Targaryen name and legend are useful, but only in so far as they are useful in producing and legitimizing his ideal enlightened despot.
As far as Varys was concerned, Rhaegar wasn’t suitable to play that role because he had been “taught that kingship is his right” rather than his duty, and had never gone through Varys’ carefully-designed curriculum for training the perfect prince.
Moreover, Rhaegar had quite a few signs of being the wrong kind of Targaryen – he was melancholy and unpredictable, fixated on the tragedy of Summerhall, and was obsessed about prophecy and his role as the messiah. With a bit of stress and a bit of a push, one could easily see him following his grandfather’s path to wrack and ruin.