My own way of getting around this is to avoid consciously inserting an agenda at all. I hate being preached at, and am incredibly wary of such books/films/TV programmes. I can detect an agenda immediately, and it provokes an instant eye-roll (even if I agree with the message). Instead, I simply try to write an entertaining story that I would enjoy, with no conscious agenda at all. What I have found is that what is important to me ends up being inherent in the text, but not in a preachy way.