Understanding how parasites are transmitted to new species is of great importance for human health, agriculture and conservation. However, it is still unclear why some parasites are shared by many species, while others have only one host. Using a new measure of 'phylogenetic host specificity', we find that most primate parasites with more than one host are phylogenetic generalists, infecting less closely related primates than expected. Evolutionary models suggest that phylogenetic host generalism is driven by a mixture of host-parasite cospeciation and lower rates of parasite extinction. We also show that phylogenetic relatedness is important in most analyses, but fails to fully explain patterns of parasite sharing among primates. Host ecology and geographical distribution emerged as key additional factors that influence contacts among hosts to facilitate sharing. Greater understanding of these factors is therefore crucial to improve our ability to predict future infectious disease risks.