John Barrowman thinks that I fancy him. I'm not sure why - I said something complimentary about the male characters in Doctor Who, the series in which he makes occasional scene-stealing appearances as Captain Jack Harkness, and he appropriated it for himself, because he's gorgeous and used to people fancying him. Now we're talking about the fluid nature of sexuality and attraction. "You could find Captain Jack attractive. Hey, you could find John attractive," he says, twinkling away at me like a rope of promenade lights on a gusty night, "and I could find you attractive. But that doesn't mean that anything's going to happen." I am suddenly hotly aware of the close confines of the dressing room buried beneath the BBC's Television Centre in which we are cocooned. "Right?" he says.

Too right - not least because of the new BBC1 show he's here to talk about. The Making of Me asked three celebrities to use scientific testing, psychology, brain science and genetics to investigate the origins of their defining characteristics, each in their own show. Vanessa Mae asks why she is musical, Colin Jackson wonders why he is fast, and Barrowman finds out why he is gay: a fact which I think is going to stand in the way of our blossoming mutual attraction. The results of the programme - is it nature, is it nurture? - are a closely guarded secret, though Barrowman has always been convinced that sexuality is not a choice. "I've always known who I am," he says. "That's what I believe. I feel I was born this way. I've never questioned that."

Until now, of course, and the issues that the programme addresses do raise one potentially uncomfortable point: if the conclusion is that homosexuality is a choice, learned behaviour or the result of a particular experience at a certain time, does that mean that gay people can choose again, or unlearn their preferences? Could he? "It's not going to change who I am," he replies, instantly. "I always said, if the outcome is you're born this way, I'm going to be ecstatic. If the outcome is that it's something that happens to you, a trauma or it's your choice, I will have to reflect and think about that, but it's not going to change who I am because I like who I am." If it is a choice, it's a choice he'd make again.

And why wouldn't he? As he tells it, Barrowman's experience of life as a gay man has been overwhelmingly positive. At 41, he has a supportive and devoted family, a 15-year relationship with his partner, Scott Gill, and a successful career (before starring in Doctor Who and its spin-off series, Torchwood, and graduating from there to appearances as a judge on the find-me-a-star reality shows Any Dream Will Do, How Do You Solve A Problem Like Maria? and I'd Do Anything, he enjoyed a long and happy period as a leading man in the West End, mainly in musical theatre).

He mentions interviewing a Seventh Day Adventist "ex-gay" man while filming The Making Of Me, who believed that homosexuality was incompatible with a fulfilling life. "His idea was that you had to have the white picket fence and the farm and he was talking about it like it was something that I could never have," says Barrowman. "And I actually said to him, 'Yeah, but Ron, I have a partner, I have a dog, I have really nice cars, I have a beautiful home, I have a home by the sea and the beach. You can have that and be gay.' But he just couldn't see that."

Barrowman can see it. He and Gill are thinking about having children. "We're building a house in Cardiff on the beach. We're going to have six bedrooms in it and we feel like we've got a lot to offer." He says that from talking to different families for the show - both accepting of homosexuality and not - he learned that "a family unit is what you make a family unit".

Almost the first thing Barrowman does when he starts talking about the programme is insist that he's not a campaigner. "I never thought I would be like this," he says. "I never thought I'd be someone who would stand up for 'the cause'. I don't want to be a militant gay, because that's not me." But it's clear that he is naturally possessed of strong opinions. Since he and Gill became civil partners in 2006, Barrowman has always been adamant that it's not a "marriage". "I don't call it 'marriage' for my own reasons - and I would suggest to gay men and women that they don't call it a marriage, because it connotes religious organisations that don't like them, and why do we want to take that on board?"

But the recent escalation of his fame has put him in a position where he senses an obligation to do more. "I have to put it this way," he says. "There are some days that I sign, like, 400 pictures, autographs and stuff. And among those I generally get a bunch of, say, four, five emails and some written letters from young men and women who are struggling to come out of the closet and they don't know who to turn to because they're afraid of their family's reaction and they're afraid of their community's reaction. So when they approached me to do this [The Making of Me], I thought, 'Yeah, you know, I really kinda have to do it.' I do think I've got a responsibility to help change perceived attitudes or try to change them."

It's all a bit at odds with Barrowman's popular image, which starts with his showman's grin, an expert line in saucy banter and a reported fondness for showing everyone (especially co-stars who are trying to film a scene) his penis. His autobiography - Anything Goes, of course - tells stories of a carefree life in the limelight, hanging out with Claudia Schiffer on Valentino's yacht and having affairs with Spanish flamenco dancers called Paco. It's not that Showbiz John is a character that Barrowman plays for the public. Though he's clearly a born performer, there's no hint of concealed anguish beneath. It seems that he really is this upbeat, this positive, this happy, all the time. In TV appearances, he throws himself into the job with force: always eager to get the joke, make the joke, be the joke. It looks like uncontainable exuberance; sometimes it looks like he is having so much fun he may burst.

There is, actually, something slightly comic about Barrowman. He's so absurdly good looking, for one thing, and in such an obvious way: the teeth, the hair, the wide cheekbones and the blue, blue eyes. His American accent is almost too reassuringly warm (though he is able to segue into a broad Scottish brogue in seconds, a legacy of the first nine years of his childhood spent in Glasgow before moving with his family to Illinois, which is incredibly disconcerting; like being dragged across the Atlantic by your ears. He says both accents are his "natural" one) and his speech is peppered with phrases that, looking back, seem like fortune-cookie clichés: "I don't ask that you like me. I just ask that you respect me," is a favourite.

But at the time, and on him, it all works, because it's so patently sincere. He is just instinctively polite - waiting for me to turn over the tape in my Dictaphone before continuing a point, which hardly anyone ever does - and conscientious, diligently checking his notes from the programme to make sure he's getting it right. He is thoughtful and articulate, talking in long, seamless sentences, with passion and certainty. He might employ a hackneyed phrase every now and again, but it's because he believes them. And he has a natural solidity. You can see why he works on stage: he's tall and broad and booming; he's sure of what he's saying, and of himself.

In that, he's similar to his Doctor Who/Torchwood character, Captain Jack, who first appeared as a wayward interplanetary scoundrel who found friendship and redemption in the company of the timelord. On the one hand, he's cookie-cutter, old-school hero, all jutting jaw and big guns. On the other, he's a cheeky pan-sexual adventurer ("so many species, so little time") who landed a kiss on Christopher Eccleston's Doctor in the concluding storyline of the first series.

But - and this seems to be very Barrowman, too - Jack feels no tension or conflict about who he is. He lives in the confident expectation that the universe will order itself around him. Which it does. Captain Jack is one the best-loved of the returning characters - Torchwood was created pretty much to keep him on our screens - and his unapologetic eye for the gents as much as the ladies seems only to add to his appeal.

"I was doing a signing at a convention," Barrowman says, "and this father brought his son over and he said, 'Do you want Captain Jack's autograph?' and the kid said, 'Yeah, Dad, I don't care if he likes boys, he's still my hero.' And I thought, 'That's why I'm doing this.'

"I'd love to be a hero and that's why I love playing him, because he is a hero. But then, funnily enough, people have written to me and said I am their 'hero'" - he says the word with self-deprecating verbal air quotes - "because of standing up for what I believe in".

· John Barrowman - The Making of Me is on BBC1, July 24