Our Gemara on Amud Aleph discusses a scenario of wo women who are accused of infidelity and are required based on the evidence to go through the Sotah trial and ordeal in order to either prove innocence or encourage confession. These women do not undergo the ordeal together, as one person’s resolve might give the other inappropriate courage.
Rashi (Sotah 8a) explains that if one of the women honestly did not commit adultery and therefore submits to the ordeal, it will artificially “en-courage” the other, who is actually lying, to continue into the trial without confessing. It is interesting because the Mefaresh in Nedarim explains that the woman will be emboldened by the company of a peer. This hints at a subtle distinction. According to the Mefaresh, perhaps BOTH are lying; but their company still gives the other false confidence. The Mefaresh’s language is, “And so what if I drink from the Sotah waters? After all, I have my friend with me.”
The idea that a person’s moral decision making is significantly impacted by peers has been demonstrated conclusively in research, (see for example, “How peer influence shapes value computation in moral decision-making”, Hongbo Yua,.Siegel, Clitherob, Crocketta, https://doi.org/10.1016/j.cognition.2021.104641 )
Our sages were fully aware of such influences, and notably in the coming parasha, Be’er Mayyim Chayyim Vayechi (1:8) even attributes Pharaoh’s good behavior and subsequent regression into evil as coming from no longer having the association and positive influence of Yosef.
As mature adults, and not angry and rebellious children, as much as we like to believe in our autonomy and our own objective decision making, we are influenced by the company we keep. (See Rambam Pirkei Avos 1:6 and Rabbenu Yonah, who both make important points about the effects of friends to call you out on your shtick and keep you in-line.) This is why choice of neighborhoods, schools and shuls do really count.