Sherlock feels sentiment is destructive. It ruins one’s ability to think, and he can’t bear to get attached to people because it hurts too much to lose them. He also hates how people manipulate one another’s emotions; it disgusts him. He can’t even begin to contemplate sex and relationships.
He gets lonely, though, so he wants someone around — but no one can ever stand Sherlock. If they like him it’s usually hero worship and they always have expectations of him, or want things from him, and he’s never been able to be a normal person. People get disappointed and leave.
Until John. Sherlock gets attached to John and doesn’t like how it compromises his ability to think. He is constantly obsessing over John leaving or dying. But he can’t function without him when he tries to push him away, and making John feel bad makes Sherlock feel bad.
Here is the thread of Sherlock’s feelings for John, episode by episode, below the cut: