If for example TPTB wrote Wesley Crusher as gay, and he come out in say season two or three, what would be wrong with that?
The problem lies in how to do it.
Wesley has realized he's gay, and basicly simply tells his mum. He'd probably be as shy as any teenager admitting he's in love, but there will be no shock from Beverly whatsoever. That's it. No problem.
However, now you have to write an episode where it happens. For some people, both straight who support this and people in the LBGT community, doing only this and nothing more, could feel insulted for having it only as a 1 minute clip in an episode and that's it. They've wanted a gay character for so long, and now it's almost nothing more then a footnote.
So, you want to write a whole episode about it. Having it being a problem for Wesley to come out of the closet and being scared of people's reaction, would seem unrealistic for the 24th century, because we can asume by now that there is no more closet to come out of. Everything would just seem odd, forced and overly dramatic.
So, let's say, Wesley has realized he's in love with a male ensign, and they are somehow stranded on an alien planet, with a species that is completey against being gay, they punish/imprison/kill them, and they have a way of 'detecting' gay. Everything about an episode like that would sound contrived, convenient, over the top, to obvious, silly, stupid, whatnot. There's really only a small change that episode will be properly written and will do the cause of exceptence for gay people any good when it is basicly a bad episode.
The only thing that really would work, is to have a character on a show established as being gay, and just being gay. No fanfare, no big deals, no akward reactions from fellow humans, or aliens that are part of the Federation really, since one of the conditions for being allowed membership is no bigotry. He/she simply is, and that's cool.