This study investigates the environmental protection behavior of farmers in the Guanzhong Plain region and the factors influencing their participation, in order to improve the enthusiasm of farmers’ participation and promote the formation of “good governance” in rural ecological environments. Based on interviews with 295 farmers, the influence of psychological cognitive factors on farmers’ intention and behavior to participate in environmental protection was analyzed using partial least squares structural equation modeling under the extended theory of planned behavior, and the moderating effect of policy environment in the relationship between farmers’ intention to participate and participation behavior was revealed. The research results show that: (1) The current situation of farmers’ participation in environmental protection is generally characterized by “strong intentions and weak actions”. (2) Participation consciousness and benefit perception have a greater impact on farmers’ intention to participate in environmental protection, perceived behavioral control has a smaller impact, and subjective norms do not have a significant impact. (3) Perceived behavioral control and participation intention have a greater influence on farmers’ participation in environmental protection behavior, subjective norms have less influence, and there is no direct influence of perceived benefits and participation awareness on farmers’ participation behavior, i.e., farmers’ participation intention has indirect influence on participation behavior. (4) The moderating effect of policy environment indicates that policy environment has a significant positive effect on the relationship between farmers’ participation intention and participation behavior.