Historical, evolutionary, and ecological processes jointly shape the structure of communities, and the relative influence of such process may vary from one region to another. Nevertheless, much of community ecology focuses on one or several communities in a given region. To assess the relative importance and the context‐dependency of processes shaping communities, studies in community ecology must be conducted across regions and along broad‐scale environmental gradients. Regionally, historical colonization and extinction events, as well as diversification, can influence community structure by shaping the pool of potential community members (i.e., the regional species pool). Locally, a suite of deterministic and stochastic processes can influence community structure. We constructed a large time‐calibrated phylogenetic tree for North American odonates and used analyses of phylogenetic community structure with explicit species pool definitions to assess the predominant processes structuring assemblages along a north–south environmental gradient spanning two biomes and 8° of latitude in eastern Canada. Phylogenetic analyses of 39 lentic (i.e., lake) odonate communities revealed that co‐occurring species were on average more closely related than expected by chance, but only in the temperate biome. In addition, site‐to‐site variation in phylogenetic structure across the temperate and boreal biomes was most strongly related to variation in water pH. The most alkaline lakes were in the temperate biome and were also the most phylogenetically clustered, suggesting that water pH acts as a main environmental filter of odonate communities. An alternative explanation was that the recent radiation of damselflies increased the diversity of this group relative to that of dragonflies in the temperate species pool, thereby leaving a signature of clustering in that biome. However, our comparative null model analyses with explicit species pool definitions at least partially ruled out this explanation. Somewhat contrary to previous hypotheses regarding the assembly of odonate communities, our results suggest that stochastic processes alone cannot account for community structure in odonates and that deterministic, niche‐based processes have a strong influence.