The experience of Mary (Zoe Perry) in explains why Sheldon was horrible to his friends in . Despite his intellect, there's one thing that Sheldon struggled with — socializing. So it was almost a miracle that he found a loyal group of friends who stayed with him amidst all his flaws on Sheldon's lack of human skills wasn't the only thing that made it difficult to hang out with him. Sometimes, it's almost as if he was intentionally trying to hurt his Pasadena-based friends, which made it more impressive that they stuck with him all those years.
In fact, the gang's endurance of Sheldon always looked quite odd. But, at least delves deeper into him by exploring his childhood with his family in Texas, and goes some way to explain his quirks and justify them to a certain extent. Instead of focusing on just its titular character, it also puts an ample interest in the rest of the Cooper family. This makes and also offers a greater sense of context to the adult Sheldon. Things have been quite difficult for the clan recently as they are faced with different issues. Mary's experiences in season 5 may have directly impacted how Sheldon conducted himself around his friends in.
After news broke out of Georgie's (Montana Jordan) unexpected pregnancy news, the Coopers became the talk of the town. Mary was unceremoniously fired by Pastor Jeff (Matt Hobby) and despite her devotion to her church, the whole congregation turned its back on her. This deeply hurt Mary, especially after everything she gave the congregation; she was nothing but a loyal friend to Pastor Jeff, sometimes even prioritizing helping him over her own husband. Seeing this, Sheldon came to the conclusion that everyone would ultimately betray him. So when (Johnny Galecki) and the rest of the Pasadena gang, he consciously acted out at times just to see how much he can push them until they leave. It was his way of protecting himself from suffering the same fate that his mother did. Unbeknownst to him, his friends are nothing like Mary's fellow church members.
Over the years, Sheldon somehow mellowed down with his behavior. He learned how to truly trust his friends, even sharing George's (Lance Barber) cheating story with Penny (Kaley Cuoco). Sometimes, however, he would still slip and do something incredibly selfish and infuriating to his friends. A case in point was which almost forced all of his friends to not attend his Nobel Prize awarding ceremony. Ultimately, however, much like countless times in the past, the Pasadena gang stayed and collectively decided to be patient with Sheldon. The group's continued tolerance towards the socially-inept genius stems from their belief that his horrible behavior isn't usually intentional. Most of the time, he doesn't recognize how offensive he is, so Leonard and the rest tend to be more lenient towards him.
Despite everything that Pastor Jeff and the rest of the congregation did to her, Mary will still return to church in season 6. It's uncertain how this will pan out at this point, especially since this means that she will have to (Dan Byrd). If her community continues to betray her, however, it will reinforce the idea that Sheldon's behavior towards his friends was motivated by seeing her mother's suffering.