An accent aids in an identity. My accent is English, thus when I speak I am identifiably English. The words and figures of speach I use are adopted from what is around me. I wasn’t born with an English accent, I learnt it. And if I moved somewhere else I would probably adopt another accent, different figures of speach.
Part of being in a community and identifying with a community is blending in - if a large group of people speak the same way and you identify with that particular group, you’ll probably start to speak the same way too. If I wanted to blend in in California, I’d pick up a Californian accent and start saying “like, dude” a lot.
If there was a group of people who are gay and speak a certain way, and I wanted to identify myself as a member of their group, I’d pick up their speach patterns too. If all my friends pronounce “water” “throatwarbler mangrove” then, after getting over the initial laughter, I’d probably do it too.
People adopt accents to a greater or lesser degree and for different reasons. Gay culture puts emphasis on being proud of who you are, not hiding your sexuality. One way to do this is to pick up a recognisable “gay” accent and/or lexicon. You see Jack out of Will & Grace and you think “If I talk like him, people will identify me as gay and I want to be identified as gay”.
Is your problem the fact that people put on fake accents? Because I can assure you you weren’t born with yours. Your accent comes from the people that surround you, and how you want to be identified. If you’re Texan and proud of it, you’ll speak with a Texan drawl. If you’re from Boston and want people to know it, you’ll tell them you live in an “apahhhhtment”. It’s not a gay thing, it’s an identity thing.
As for when/where a gay accent developed, who knows? This is my educated guess: Remember that not so long ago, code words and euphamisms were completely necessary due to laws and the prejudices of society as a whole. There have always been ways to identify yourself as gay and I would guess it came out of that. You could wear a handkerchief in your back pocket or you could pronounce a certain word a certain way.
I suspect you’re talking about a “fey” accent - perhaps it comes from an early rather unsubtle way of identifying a man as gay - that he talks “like a girl”. And once that distinction has been made - a man who talks “like a girl” is gay, then an easy way to show that you’re gay without sticking a big sign on your head (and thus opening youself up to prosecution and persecution) is to adopt that accent. As time has gone on, that way of speaking has become exaggerated and now that in the free world we’re supposed to be free of prejudice (ha!) it’s a distorted version of that original signal of gayness. Now a fey accent can be celebrated rather than used as a signal and so it gets extended and adopted and parodied and varied. The use of a “gay accent” is nolonger a hint or a clue, it may be a celebration of gayness.
That said, I’ve got friends with a very “gay accent” who are straight and many gay friends who have nothing like a “gay accent” at all. It’s just down to the individual as to how to they speak. You have no place getting cross with people for speaking a certain way.