Macrobenthos taxonomic and functional diversity are key indicators of ecosystem health. River–lake ecotones are key macrobenthos habitats. However, we don’t fully understand macrobenthos biodiversity patterns in these ecotones. We studied water environment, sediment heavy metal contents, and macrobenthos community, which we sampled simultaneously from 29 sampling sites along the Fu River–Baiyangdian Lake gradient in Northern China with five field surveys from 2018 to 2019. Six trait classes resolved into 25 categories were allocated to macrobenthos through a binary coding system. We used the RLQ framework (R, environmental variables; L, species of taxa; Q, traits) and fourth-corner analyses to evaluate the relationship between environmental variables and macrobenthos traits. Finally, we carried out variance partitioning to assess the contributions of environmental variables to variation of macrobenthos diversities. As the results, TN and TP contents in the river and lake mouths were lower than those in the adjacent river and lake, indicating that the river–lake ecotones played a role in purifying the water and buffering pollution. High taxonomic diversity of macrobenthos in the lake mouth and the presence of unique taxa in the two ecotones revealed edge effects, but the macrobenthos abundance and biomass were extremely low compared with those in the adjacent river and lake. We found no significant correlation between the taxonomic and functional diversity indices in the river and lake mouths. Water depth, water transparency, TN, and TP were the main water environmental drivers of macrobenthos taxonomic and functional diversity, explaining up to 45.5% and 56.2% of the variation, respectively. Sediment Cd, Cr, Cu, Pb, and Zn contents explained 15.1% and 32.8%, respectively, of macrobenthos taxonomic and functional diversity. Our results suggest that functional diversity approaches based on biological traits can complement taxonomic approaches in river–lake ecotones. Furthermore, improving water depth, transparency, eutrophication, and heavy metal pollution will improve macrobenthos diversity in these ecotones and maintain ecosystem health.