Infectious diseases have been an impending threat to the survival of individuals and groups throughout our evolutionary history. As a result, humans have developed psychological pathogen-avoidance mechanisms and groups have developed societal norms that respond to the presence of disease-causing microorganisms in the environment. In this work, we demonstrate that morality plays a central role in the cultural and psychological architectures that help humans avoid pathogens. We present a collection of studies which together provide an integrated understanding of the socio-ecological and psychological impacts of pathogens on human morality. Specifically, in Studies 1 (2,834 U.S. counties) and 2 (67 nations), we show that regional variation in pathogen prevalence is consistently related to aggregate moral Purity. In Study 3, we use computational linguistic methods to show that pathogen-related words co-occur with Purity words across multiple languages. In Studies 4 (n = 513) and 5 (n = 334), we used surveys and social psychological experimentation to show that pathogen-avoidance attitudes are correlated with Purity. Finally, in Study 6, we found that historical prevalence of pathogens is linked to Care, Loyalty, and Purity. We argue that particular adaptive moral systems are developed and maintained in response to the threat of pathogen occurrence in the environment. We draw on multiple methods to establish connections between pathogens and moral codes in multiple languages, experimentally induced situations, individual differences, U.S. counties, 67 countries, and historical periods over the last century.