This paper focuses on the ideological and political construction of the course “Probability Theory and Mathematical Statistics.” Aiming at the current situation in teaching where emphasis is placed on knowledge imparting while value guidance is neglected, and combined with the requirements of ideological and political education policies in the new era, this paper explores the integration path between professional courses and ideological and political education. Through literature analysis, case comparison, and empirical research, the study proposes a systematic implementation plan covering the design of teaching objectives, the reconstruction of teaching content, and the optimization of the evaluation system. The purpose is to cultivate students’ sense of social responsibility and innovative awareness by excavating the ideological and political elements in mathematics. The research results provide practical reference for colleges and universities to deepen the reform of ideological and political education in courses, and promote the implementation of the fundamental task of fostering virtue through education in STEM education.