I always wondered about this moment. Sherlock is so desperate for John to not reject him. He’s…embarrassed. His fear that John will just turn and walk out is almost palpable.
It makes you wonder how lonely Sherlock has really been. He has friendship and companionship right in his grasp, and in this moment, it’s as if he feels it slipping through his fingers. And it scares him.
However, it also provokes the idea of it being specifically JOHN that he wants to keep around, and for reasons other than simple expense sharing. Anyone could be flatmate. Anyone could fill the role of sharing the rent and the food costs. If John walked out, he could have gotten someone else for a flatmate. It was John that he wanted, not any old flatmate.
What a massive void in his life John filled.
Sherlock knows he will be a difficult flat-mate. Anyone could share it and they’d walk out mighty quick at the mention of murderers and with a procession of clients sitting in the living room. John represents the one man who is likely to stick around and not mind too much about experiments and noise. Even so Sherlock is still trying not to scare John away when he hides the fact that the Jaria Diamond assassin came and attacked him.
That and the fact in the original script of A Study in Pink, a conversation between Lestrade and Sherlock makes it clear that Sherlock was in a very bad place right before he met John. He was suicidal. It makes so much sense for Sherlock wanting to be accepted by John. Feeding John, fixing his limp, trying to sort the apartment,…
Also I believe Sherlock deduced John as being in the same state of mind. Sherlock’s not that oblivious about relationships and what people need and want. I mean, he uses it to his own advantage, he knows.
Guess he needed John as much as he deduced John needed him.