Cognitive bias - Confirming the attitudes of your peers
I think what you are describing here is the balance theory by Fritz Heider.

The following extract is from Online Psychology Laboratory, social balance article :


  Heider's Balance Theory (Heider, 1946) primarily focused on
  perceptions of relationships in the form of a triad. This triad,
  typically involving two people (the perceiver and another person) and
  an object of their attitudes, included three relationships. Heider
  (1958) labeled these attitudes as "sentiments," personal evaluations
  of other entities that underlie people's actions. A triad of
  attitudinal relationships is considered balanced if all three
  relationships are positive, or if one is positive and two are
  negative.