Jack Harkness was always a bit ahead of the curve on matters of sexuality. He'd lost his virginity at the age of 15 to a hermaphrodite plant, and ever since then had spent a good percentage of his life trying to top that for sheer novelty value.
The Hitchhikers' Guide to the Galaxy has this to say about Jack Harkness: "A+ shag, would bed again." Concise and probably accurate although the narrator can't confirm this from personal experience. In any case, Jack Harkness (who, confusingly, wasn't really called Jack Harkness) spent much of his surprisingly long life in pursuit of unique sexual conquests. (Though perhaps a more fitting term would be "mutually-beneficial cultural mergings.") It should therefore surprise no one that Jack Harkness felt the need to have sex with the last of the Time Lords.
By this time Jack had become a fixed point in space-time, the sort of anomaly that leaves time-sensitives doing the psychic equivalent of trying to scratch an itch in that spot just between the shoulderblades that many beings are unable to reach.
On their first day of formal schooling, Time Lords learned two things. The first was not to travel back in time to kill one's own grandfather, because that sort of thing tended to give the school a bad reputation and the extended families of the Great Houses of Gallifrey were confusing enough already without having to account for people never being born. The second was that a fixed point in space-time should not exist.
The last of the Time Lords had missed much of his own formal education by playing truant with his best friend who would later repeatedly try to kill him. But, like all children, he managed to pick up the prejudice from his parents and peers in any case. Jack Harkness was A Wrong Thing.
The Hitchhikers' Guide to the Galaxy has this to say about the Doctor: "Freelance chaotic element. If something bad happens to you, it's probably his fault. Has attractive sidekicks."
And so it came to pass that Jack Harkness was both a fixed point and an attractive sidekick. The reader may begin to have some idea where this is all leading. There are after all only a limited number of possibilities when a chaotic element meets an A+ shag.
The Doctor had tried to come to terms with being the last of his kind by avoiding all mention of the topic and sleeping with impressionable young women. Surprised that this hadn't worked as well as he had hoped, the Doctor had gained an epiphany of the sort that happens when two attractive men hug each other for emotional comfort and certain parts of the body take an unexpected interest in proceedings. Perhaps, he thought, he needed the love of a good man.
The Time Lords generally frowned on sleeping with someone in the first decade, but with their homeworld blown to timey-wimey smithereens by the planet's most infamous son there was no one around to frown disapproval or claim that having sex with a fixed point would cause blindness. Besides which the Doctor wasn't lacking in kinks of his own and having come to terms with his semi-rational hatred of fixed points he had come to think of A Wrong Thing as exactly the sort of sexual experience that might help him cope with his own existential angst.
It might be appropriate here to embellish the narrative with erotic details about the sensation of skin against skin or the slick feeling of Gallifreyan saliva (which by curious coincidence is a spermicide for Humans). By all accounts it was a rather impressive bout of sexual activity with all sorts of blasphemies uttered by those involved, including one especially harsh incantation which may or may not have caused the karmic failure of a small shoe shop in Beiruit.
The infamy of this particular sexual encounter rests upon its place in stuffy and tedious scientific journals. The interaction of a Time Lord, a fixed point in space-time, the Cardiff Rift, a sonic screwdriver device and a pair of aluminium handcuffs has occurred only once, and so it is from this sole occasion that the body of theory on such matters is formed. Known consequences include the Tunguska Event of 1908, the Great Solar Wobble of 3215, and - most significantly - a transfer of hormonal momentum to the planet below leading to a minor but permanant adjustment in the axial tilt of Sol III.
In other words, the Earth moved.