The return of Sherlock on New Year’s Day included a request for Sherlock to become a godparent, which leads him to comment on God. In the episode Sherlock says, “God is a ludicrous fiction, dreamt up by inadequates who abnegate all responsibility to an invisible magic friend.”
Yet in the same episode, Sherlock shows himself unable to get jokes made at his expense, and we also learn how his views on determinism have changed. He now views premonitions and intuition as real and insightful but natural phenomena.
But most interestingly, Sherlock comes back more than once to the vow he made to them, despite his dismissive words about God and godparenting, which were the context for that vow.
Mary uses random moves hoping to evade Sherlock, but he tracks her, first claiming that nothing is truly random, but then acknowledging that he put a tracking device in her memory stick.
And later, after Mary is killed, Sherlock goes for counselling, in what looks like the top floor of a church.
And at the very end of the episode, Sherlock returns to the running theme of the episode, which has been the famous story of the merchant running from death when he sees him (to both his and death’s surprise) in Baghdad: can Samarra be avoided?
And so within the framework of the episode, Sherlock’s dismissive words about God seem less compelling, despite his brilliance in certain kinds of deductive reasoning and observation.
Of related interest, see the recent post by Russell Cowburn (a physics professor at Cambridge University) on why he is a Christian. It starts with the limited perspective on the universe by another high-functioning sociopath who is quite brilliant in some respects but completely inept in others: Sheldon Cooper.