Well, to be honest, mostly he does not do so—because the Victorian detective story didn't really exist as a coherent genre. There were mysteries a plenty, but they were more part of the larger Gothic novel. Works like "The Castle of Otranto" or "Frankenstein" had mysteries in them. Odd things happened, and they needed to be resolved. However, the rules weren't really set. The odd things weren't always crimes that were to be resolved through legal actions, and so the genre…didn't much happen. It's there in Poe (the Dupin stories) and Collins, and traces in Dickens, but otherwise, it didn't much exist.
That said…Holmes fits with the rationalized Gothic. The events are often odd, seemly impossible or supernatural, and he resolves them through reason. He often dips into the underworld and into dark passions.
I beg to differ. A thorough study of detective fiction - starting with Poe in the 1840s and tracing it through the stories of Doyle, reveals a genre absolutely loaded with the social discolations of the Victorian Era. We tend to look at the Victorian as prim, proper and dominated by order - this is true on some level. However, as the Industrial revolution pours individuals into cities, there's a real necessity for authorities to show that crime is being combated by credible forece. As we have an increase in mercantile prosperity, we also have increased physical and social mobility. Normally, we think of this as good. However, in the second half of the 18th century we see that crime skyrockets. People are scared, they are in unfamiliar territory, cheaper and more efficient news organs produce sensational stories. And thus increasingly, citizens want/need answers.
As Michel Foucault noted, the nineteenth century was somewhat defined by a reimagining of the disciplinary nature of the modern world - in such things as law, education, prisons, trains, and medicine. In particular, Mr. Sherlock Holmes seems particuarly apt for this type of social dislocation, since he provides readers with fables of protection. He recognizes and defeats forces that would threaten Victorian order (note, too, that many Holmes villians are physically grotesque or disheveled). He adds a layer of rationality and science that fits nicely with the dominant narrative of progress through technology, and he treats women patronizingly. In so many ways, he perfectly represents the well-to-do Victorian gentleman selflessly providing for the greater good - particuarly of the Crown.
In addition, the stories of Gaboriau, the novel The Levenworth Case, and Wilkie Collins, along weith several others (see the Michael Sims Anthology "The Dead Witness" ) allow us an excellent peek into how the Victorian Crime fiction progresses.