He would be devastated to know what happened after he failed, too. Daenerys’ murderous rampage meant the loss of all the people that Varys had tried for so long to protect.
Hence, Varys could have easily seen the same signs emanating from Daenerys, inspiring him to make his move.
Daenerys executed Varys assumedly without knowing he may have been trying to kill her.