This article examines the necessity of protecting public morality as an object of criminal law using the example of the crime of pimping and maintaining brothels. This crime, being a complex social phenomenon, serves as a determinant for other more serious offenses such as violence, the spread of venereal infections, the organization of criminal groups, the distribution of narcotics, etc. The article provides examples from judicial practice and describes the personality of the perpetrator of these acts, as well as presents an analysis of literature and research on preventing the crimes of pimping and maintaining brothels.