This article discusses the strategic role of instilling moral and social values and providing comprehensive education to prevent deviant behavior. Furthermore, schools also play a role in providing educational sanctions and counseling for students who commit deviant behavior. One of the most important elements in education is morality. Morality is a set of principles or standards of behavior used to distinguish between right and wrong actions. It is a guide that helps individuals and societies determine what is considered good or bad, just or unjust, and acceptable or unacceptable. Educators should be able to understand the categorical imperative of the Kantian model to carry out their functions as autonomous human beings. This study uses a descriptive qualitative approach with the aim of in-depth describing the contribution of schools to student morality and its influence in controlling social deviance. The results of this study are expected to contribute to the development of educational policies that are more oriented towards character formation and social values. In the context of increasing cases of juvenile delinquency, drug abuse, violence, and a permissive culture, it is important to reexamine the function of schools not only as centers of academic learning but also as agents of character formation. This study uses a descriptive qualitative approach with the aim of in-depth describing the contribution of schools to student morality and its effect in controlling social deviance. The results of this study are expected to contribute to the development of educational policies that are more oriented toward character formation and values.