As a heritable sequence-specific adaptive immune system, CRISPR–Cas is a powerful force shaping strain diversity in host–virus systems. While the diversity of CRISPR alleles has been explored, the associated structure and dynamics of host–virus interactions have not. We explore the role of CRISPR in mediating the interplay between host–virus interaction structure and eco-evolutionary dynamics in a computational model and compare the results with three empirical datasets from natural systems. We show that the structure of the networks describing who infects whom and the degree to which strains are immune, are respectively modular (containing groups of hosts and viruses that interact strongly) and weighted-nested (specialist hosts are more susceptible to subsets of viruses that in turn also infect the more generalist hosts with many spacers matching many viruses). The dynamic interplay between these networks influences transitions between dynamical regimes of virus diversification and host control. The three empirical systems exhibit weighted-nested immunity networks, a pattern our theory shows is indicative of hosts able to suppress virus diversification. Previously missing from studies of microbial host–pathogen systems, the immunity network plays a key role in the coevolutionary dynamics.