The best thing against this is to promote sex-positive values. You can't be blackmailed about some sex habits if you're not going to be ashamed of them :) it will also really tick conservatives off which isn't a bad side-effect.
The only sexual habits people should be ashamed of are non-consensual sex and anything underage of course.
But the conservative values are the very reason many people can be blackmailed in the first place.