British television seems to do a better job with gay characters, because so many British actors are out of the closet that it doesn't tarnish anyone's reputation to play a gay character. I've heard it said that in Britain, actors can come out with no ill effects, but politicians would lose their careers, whereas in the U.S., there are openly gay politicians, but a gay actor's career would end upon coming out. (Michael Ontkean and Harry Hamlin, two straight actors who played gay men in Making Love, didn't work for a decade after that movie came out.)
My favorite British show is Torchwood, because of the way all the characters were screwing one another right and left. And the sex scenes worked, because all the actors were good enough to carry it off. By contrast, Will and Grace drove me nuts, because Eric McCormack made a very unconvincing gay man. (Though perhaps it wasn't completely his fault, because the character wasn't all that well-written, either, when you get right down to it.) Not to mention that the publicity for the show emphasized McCormack's heterosexuality out the wazoo.
Granted, there has been progress. Madam Secretary has two characters, Kat Sandoval (Sara Ramirez) and Blake Moran (Erich Bergen), highly-placed State Department officials who aren't afraid to be themselves, and it has dealt with queer issues in a number of episodes. B.D. Wong also appears occasionally as the head of a gay rights lobbying organization, and his character is portrayed as a fairly close friend to the Secretary's chief of staff. But as far as I'm concerned, there aren't enough shows like that on the air.