Sherlock thinks that sex should keep John quiet and happy. He also misses how underwhelmed with their relationship John is. Sherlock doesn't give John what he needs emotionally so John goes and finds it with Lestrade. John can't help but compare how differently they interact with him. Sherlock is sharp and dismissive and Lestrade is warm and tactile. So, John decides he deserves something for himself.
John cheats with lestrade