I don't write fanfic, but I kind of write it. It's called 'spec scripts'. You write an episode of a TV show, with the characters from that show, in order to demonstrate your ability to use someone's template of a show in order or make an episode that feels like that show. You do this as a sample, to get a job. No one pays to read it, and you don't get paid to write it (which is what the 'spec' part means - it's 'on speculation').
When you write a spec script, you don't change the template. Cosby doesn't meet Cthulhu. If you change the template, you're not showing what the readers want to see - which is your ability to write that show.
Now this isn't what most people call 'fanfic'. What people mean by 'fanfic' is something to show off to other fans of a series, and it seems to run a gamut from 'let me tell another story of X character, just like those that I love to read,' and, 'let me tell a story that uses all these random characters from random places in order to tell my story, which will be very different from any of the originals'. And I'm not against any of this - mashups can be great art, in my view, as much as anything else can be. If there's a reason I don't read fanfic, it's probably that I've only got so much time, and authors who've gone through the editing and selection process - or worked their heart out marketing their own stuff - are more likely to produce things of sufficient quality as to justify my time.
That said, I think there's an important spot that fanfic fits into: a spot where characters are a collective memory of the audience, who builds on them to create their own myths. A place we've lot sight of since long ago when in The West we mostly left the realm of oral histories behind. So I think it can be *great* that people make fanfic. If I ever make characters that someone wants to use in fanfic, I'll be flattered.
I would suggest, however, that no matter what fanfic writers should focus on being respectful to both the characters they use and the template of the original stories. Gilgamesh, Heracles, and Achilles were characters everyone could write about - but every story we have of them now is respectful of these figures. There's no Heracles-slash-Achilles fanfic from Ancient Greece. Critical commentaries on a character or template are very appropriate. Mashups are all well and good too. But any pastiche should make it pretty clear that you're pointing towards well-known characters, as caricatures - that you aren't trying to use the 'real character' to make a story that doesn't fit the depths of that characters' own nature. To do otherwise is disrespectful of the figures that the very term, 'fanfic', indicates that you love.