Sherlock genuinely likes Janine. He’s genuinely fond of her. That makes it, in his mind, ‘Well, at least I’ll be able to tolerate her company.’ The fact that he then crushes her the way he does is no different from how he behaved to John. He adores John, but he was perfectly happy to pretend to be dead for two years, and then think, ‘It’s really funny if I just jump out of a cake and say hello again.’
Steven Moffat talks about Sherlock & Janine’s relationship. Source (x)