Genetic variation at the major histocompatibility complex (MHC) is vitally important for wildlife populations to respond to pathogen threats. As natural populations can fluctuate greatly in size, a key issue concerns how population cycles and bottlenecks that could reduce genetic diversity will influence MHC genes. Using 454 sequencing, we characterized genetic diversity at the DRB Class II locus in montane voles (Microtus montanus), a North American rodent that regularly undergoes high-amplitude fluctuations in population size. We tested for evidence of historic balancing selection, recombination, and gene duplication to identify mechanisms maintaining allelic diversity. Counter to our expectations, we found strong evidence of purifying selection acting on the DRB locus in montane voles. We speculate that the interplay between population fluctuations and gene duplication might be responsible for the weak evidence of historic balancing selection and strong evidence of purifying selection detected. To further explore this idea, we conducted a phylogenetically controlled comparative analysis across 16 rodent species with varying demographic histories and MHC duplication events (based on the maximum number of alleles detected per individual). On the basis of phylogenetic generalized linear model-averaging, we found evidence that the estimated number of duplicated loci was positively related to allelic diversity and, surprisingly, to the strength of purifying selection at the DRB locus. Our analyses also revealed that species that had undergone population bottlenecks had lower allelic richness than stable species. This study highlights the need to consider demographic history and genetic structure alongside patterns of natural selection to understand resulting patterns of genetic variation at the MHC.