The increasing trend of farmers abandoning their farmland amid urbanization poses significant challenges to sustainable agricultural development and threatens national food security. This study employs evolutionary game theory to analyze the drivers, constraints, and policy regulation strategies associated with the farmland abandonment by farmers in the context of urbanization and aging in China. The findings indicate that urbanization and demographic aging significantly influence farmers’ decisions to abandon their farmland. Government regulations, including incentives and penalties, face constraints from various factors. Farmers are often drawn to abandon their land because of the higher income potential from urban employment and land rental, coupled with the burden of farming and opportunity costs. Conversely, potential losses from land transfer income, agricultural product revenues, the quality of farmland, and lower levels of aging serve as constraints that affect farmers’ decision-making and land utilization behaviors. Furthermore, proactive regulation by local governments can effectively deter farmers from abandoning their land. However, the success of government policies in protecting farmland relies on a synergistic approach that balances incentives and regulations. Therefore, it is crucial for policymakers to consider multiple factors and adapt policy designs flexibly to align with local conditions. This study aims to provide theoretical insights and practical guidance for developing more effective and scientifically grounded farmland protection policies.