There is no certainty as to Dr. Henry Jekyll's sexuality in The Strange Case of Dr. Jekyll and Mr. Hyde. We can speculate about it based on what we read and make inferences of our own. However, Robert Louis Stevenson would have not ventured to openly state such a detail about a main character in any novel, much less when the main character is a popular, well-respected member of high society. This is not because of Stevenson's own views on homosexuality, but mainly because homosexuality was considered a crime in nineteenth-century England.
Jekyll's possible homosexuality fits into the theme of duality in human nature that dominates the book. Stevenson asks, Can we separate the acceptable and unacceptable parts of ourselves? To what extent? This theme is explored through the character of Dr. Henry Jekyll, a smart, charming, and popular bachelor with a respectable career as a physician. Jekyll has been secretly working on a potion that will transform him physically into an entirely different person.
This person, who is actually Jekyll transformed into a different body and persona, goes by the name of Edward Hyde. Jekyll and Hyde are countervailing forces. Jekyll is the charming, acceptable, and "proper" man with a secure place in upper-class society, while Hyde embodies every secret vice, desire, and "sin" hiding in Jekyll's heart—perhaps including homosexuality. Hyde acts upon these desires without guilt or inhibition, and his immorality is apparent in his appearance, as those who encounter him find him mysteriously but undeniably repugnant.
The purpose of creating Hyde was for Jekyll to explore his secret vices without consequence. After pursuing his desires under the guise of Hyde, he would simply transform back into his ordinary self. In the end, however, these two personas meet at a tragic, abhorrent midpoint that causes the ultimate demise of Dr. Jekyll (and therefore of Mr. Hyde).
Because Victorian society viewed homosexuality as unacceptable and a vice, it is possible that Stevenson meant to code Jekyll as a homosexual man who represses his homosexuality, just as he represses his other socially unacceptable desires and behaviors in order to remain an upstanding member of polite society. The story does not specify Jekyll's sexual orientation, but its focus on the repression of socially unacceptable behavior in general has led many critics to view it as an allegory for repressed homosexuality.