Where do you find your friends? How'd they get to be a part of your life? What were they like when you met them, or have they always been that way?
And, more importantly, what are you putting out there that attracts such friends? As Dodger712 so wisely observed, you want to become the kind of man you want to attract. If you are a victim of negative thinking and tend to wallow in your misery, that's who you're going to attract; if, on the other hand, you put yourself out to be kind and caring and trustworthy, you display and believe in a positive attitude, that that is the kind of friends you will attract.
My experience is that negative people are all over the place, gay, straight, and otherwise, and sometimes they're hard to avoid; but after a while they're very easy to spot... all you have to do is listen to the themes of what they talk about. Not just the party-chat, but the underlying message.
If he or she is talking smack about somebody (it may be very witty and amusing, but it's tearing someone down), or praising somebody with an envious tone (notice how so many gay men just love eccentric, egotistical, rather bitchy divas? Madonna, Mariah, Barbra, Callas, etc? That's who they want to be like), or simply complaining about something stupid (the service, the music, the state of the world, other people's outfits), just smile and nod and edge slowly away.
So what do you do about it? The first thing I suggest is to look at where you are doing your socializing. Is it in a bar? Or a slightly incestuous circuit of private parties? Or in a gay ghetto or gayborhood? Well, then, that might be the problem.
Get involved, instead, with an organization that is doing something to better the lot of your fellow man. Project Open Hand or Stop AIDS or Youth OutReach or something, hunt down your local LGBT community center for ideas, they're always looking for volunteers; anything of that nature will put you into contact with positive, good-hearted people. Of course, there will also be negative, controlling assholes (you simply can't escape them), but they're rather outnumbered and don't really matter.
The secret is to turn yourself outward, open yourself up to others instead of centering on yourself, and get involved with your fellows; to make sex and partying a sensational pastime rather than a full-time vocation; and to get out of the incestuous, high-school-gossipy little circles that spin around in bars and cafes.