Understanding the dynamics of cooperative behavior of individuals in complex societies represents a fundamental research question which puzzles scientists working in heterogeneous fields. Many studies have been developed using the unitary agent assumption, which embeds the idea that when making decisions, individuals share the same socio-cultural parameters. In this paper, we propose the ECHO-EGN model, based on Evolutionary Game Theory, which relaxes this strong assumption by considering the heterogeneity of three fundamental socio-cultural aspects ruling the behavior of groups of people: the propensity to be more cooperative with members of the same group (Endogamy), the propensity to cooperate with the public domain (Civicness) and the propensity to prefer connections with members of the same group (Homophily). The ECHO-EGN model is shown to have high performance in describing real world behavior of interacting individuals living in complex environments. Extensive numerical experiments allowing the comparison of real data and model simulations confirmed that the introduction of the above mechanisms enhances the realism in the modelling of cooperation dynamics. Additionally, theoretical findings allow us to conclude that Endogamy may limit significantly the emergence of cooperation.