In many biological populations, individuals face a complex strategic setting, where they need to make strategic decisions over a diverse set of issues. To study evolution in such a complex strategic context, here we introduce evolutionary models where individuals play two games with different structures. Individuals decide upon their strategy in a second game based on their knowledge of their opponent's strategy in the first game. By considering a case where the first game is a social dilemma, we show that, as long as the second game has an asymmetric Nash equilibrium, the system possesses a spontaneous symmetry-breaking phase transition above which the symmetry between cooperation and defection breaks. A set of cooperation supporting moral norms emerges according to which cooperation stands out as a valuable trait. Notably, the moral system also brings a more efficient allocation of resources in the second game. This observation suggests a moral system has two different roles: Promotion of cooperation, which is against individuals' self-interest but beneficial for the population, and promotion of organization and order, which is at both the population's and the individual's self-interest. Interestingly, the latter acts like a Trojan horse: Once established out of individuals' self-interest, it brings the former with itself. Furthermore, we show that in structured populations, recognition noise can have a surprisingly positive effect on the evolution of moral norms and facilitates cooperation in the Snow Drift game.