Habitat fragmentation is an important driver of biodiversity loss and can be remediated through management actions aimed at maintenance of natural connectivity in metapopulations. Connectivity may protect populations from infectious diseases by preserving immunogenetic diversity and disease resistance. However, connectivity could exacerbate the risk of infectious disease spread across vulnerable populations. We tracked the spread of a novel strain of Mycoplasma ovipneumoniae in a metapopulation of desert bighorn sheep Ovis canadensis nelsoni in the Mojave Desert to investigate how variation in connectivity among populations influenced disease outcomes. M. ovipneumoniae was detected throughout the metapopulation, indicating that the relative isolation of many of these populations did not protect them from pathogen invasion. However, we show that connectivity among bighorn sheep populations was correlated with higher immunogenetic diversity, a protective immune response and lower disease prevalence. Variation in protective immunity predicted infection risk in individual bighorn sheep and was associated with heterozygosity at genetic loci linked to adaptive and innate immune signalling. Together, these findings may indicate that population connectivity maintains immunogenetic diversity in bighorn sheep populations in this system and has direct effects on immune responses in individual bighorn sheep and their susceptibility to infection by a deadly pathogen. Our study suggests that the genetic benefits of population connectivity could outweigh the risk of infectious disease spread and supports conservation management that maintains natural connectivity in metapopulations.