The nether regions of my idea-gathering files are as disorganized as a Greenwich Village junk shop and every bit as much a source of surprises. On tidying up one such archive I found a question I'd jotted down to myself but never answered: What is the difference between fantasy and wish-fulfillment? No context, just the question, so I figured I'd have to tear into it as-is.
Definitions first; that's one easy way to set the two apart. Easy enough that it would verge on misleading, but here goes: fantasy is a genre (e.g., a reading and writing category); wish-fulfillment is an aspect of a work regardless of genre. So you can have some works of fantasy that operate as wish-fulfillment, but not all works of wish-fulfillment would end up on the fantasy shelf next to the Tolkien or the Gene Wolfe. Tom Clancy is as much a creator of wish-fulfillment as he is of thrillers.
The problem with fantasy — and SF, too, might as well get that lumped in while we're at it — is how what it presents to the reader, and the author, are so easily pressed into the service of being wish-fulfillment for its target audiences. The "nerd rapture" in SF circles is no less foolish a preoccupation than the military fetishism or the social atavism that fantasy works bring to their audiences.
Now: what if you're a creator, and you don't want to infect your own work with wish-fulfillment fantasies? In my case, the first thing I'd do is sit down and look good and hard at the wish-fulfillment fantasies I do have. Not all of them are big and obvious things, and it's typically easier to spot them in someone else's work than in your own. It was easy for me to pooh-pooh the overheated romantic fantasies that's become the stock-in-trade of a certain author of supernatural fantasy, but harder for me to see the moon-eyed romanticism that snuck into my own work and masqueraded as simple longing for a Clean, Well-Lighted Place of One's Own. But rather than throw it out wholesale, I decided to confront that tendency and see what sort of work it led me to produce when I interrogated it, when I challenged it, when I made the act of interrogating and challenging it into the substance of the work itself.
OK, that's my rather pretentious way of saying something fairly simple: if you know you like to fill your books with something, find a way to make that into the real subject of the book. But go all the way. Dig until you hit bedrock. Then build up again.