This paper considers the utility of each player consisting of two parts: the objective utility and subjective utilities. We assume that a player obtains its objective utility from the interactions with its neighbors in the spatial population. Besides, the subjective utility, which is largely ignored by previous studies, is determined by its attitudes. Here, we focus on how attitudes affect the evolution of cooperation on two different complex networks, the namely square lattice and Barabási–Albert scale-free network. First, the simulations indicate that populations with a higher average attitude can achieve a higher level of cooperation. Furthermore, a positive average attitude is conducive to promoting cooperation, while a negative average attitude leads to a decline in cooperation. Moreover, in populations with a positive average attitude, as the attitude heterogeneity increases, the average level of cooperation decreases. Conversely, in populations with a negative average attitude, increased attitude heterogeneity induces the promotion of cooperation.