Social workers are a vital professional force that participates in social governance and promotes the healthy development of society. However, at present, the turnover rate of social work professionals in China is relatively high. Drawing upon data from 624 social work students, this research investigated how public service motivation (PSM) was associated with career preferences and examined the mediating roles of altruistic motivation and prosocial behavior in this relationship. The results revealed that PSM was significantly positively linked to social work students’ career preferences. Altruistic motivation and prosocial behavior partially mediated the relationship between PSM and career preferences, respectively. Serial mediation analysis showed that altruistic motivation and prosocial behavior sequentially mediated the relationship between PSM and career preferences. These findings offer valuable implications for social work education and practice in China, providing a transferable framework for European educators addressing the global challenge of workforce retention in social services.