Peat mosses (Sphagnum) are ecosystem engineers—species in boreal peatlands simultaneously create and inhabit narrow habitat preferences along two microhabitat gradients: an ionic gradient and a hydrological hummock–hollow gradient. In this article, we demonstrate the connections between microhabitat preference and phylogeny in Sphagnum. Using a dataset of 39 species of Sphagnum, with an 18-locus DNA alignment and an ecological dataset encompassing three large published studies, we tested for phylogenetic signal and within-genus changes in evolutionary rate of eight niche descriptors and two multivariate niche gradients. We find little to no evidence for phylogenetic signal in most component descriptors of the ionic gradient, but interspecific variation along the hummock–hollow gradient shows considerable phylogenetic signal. We find support for a change in the rate of niche evolution within the genus—the hummock-forming subgenus Acutifolia has evolved along the multivariate hummock– hollow gradient faster than the hollow-inhabiting subgenus Cuspidata. Because peat mosses themselves create some of the ecological gradients constituting their own habitats, the classic microtopography of Sphagnum-dominated peatlands is maintained by evolutionary constraints and the biological properties of related Sphagnum species. The patterns of phylogenetic signal observed here will instruct future study on the role of functional traits in peatland growth and reconstruction.