The marine invertebrate fossil record provides the most comprehensive history of how the diversity of animal life has evolved through time. One of the main features of this record is a modest rise in diversity over nearly a half-billion years. The long-standing view is that ecological interactions such as resource competition and predation set upper limits to global diversity, which, in the absence of external perturbations, is maintained indefinitely at equilibrium. However, the effect of mechanisms associated with the history of the seafloor, and their influence on the creation and destruction of marine benthic habitats, has not been explored. Here we use statistical methods for causal inference to investigate the drivers of marine invertebrate diversity dynamics through the Phanerozoic. We find that diversity dynamics responded to secular variations in marine food supply, substantiating the idea that global species richness is regulated by resource availability. Once diversity was corrected for changes in food resource availability, its dynamics were causally linked to the age of the subducting oceanic crust. We suggest that the time elapsed between the formation (at mid-ocean ridges) and destruction (at subduction zones) of ocean basins influences the diversity dynamics of marine invertebrates and may have contributed to constrain their diversification.