One of the best defense against espionage is economic growth. When China was poor it was easy to buy your way into high places, but trying doing it now and at the minimum your target will be like "sure I'll betray my country for you, if you first buy me a house in Chaoyang District in Beijing" and even CIA doesn't have the budget for that.Can someone explain to me why Putin doesn’t do a purge of CIA assets? Are you seriously telling me the descendants of the KGB that ran the CIA like a dog and pony show can’t at least purge the informants out of the higher ranking officials?
The other type of turncoat is mainly motivated by ideology. The best defense against that is your own strong opposing ideology which China still has and Russia does not since they gave up on communism.
In that regard you see why Russia is so much easier to penetrate than China.