The effects of anthropogenic stressors on community structure and ecosystem functioning can be strongly influenced by local habitat structure and dispersal from source communities. Catchment land uses increase the input of fine sediments into stream channels, clogging the interstitial spaces of benthic habitats. Aquatic macrophytes enhance habitat heterogeneity and mediate important ecosystem functions, being thus a key component of habitat structure in many streams. Therefore, the recovery of macrophytes following in-stream habitat modification may be prerequisite for successful stream restoration. Restoration success is also affected by dispersal of organisms from the source community, with potentially the strongest responses in relatively isolated headwater sites that receive a limited amount of dispersing individuals. We used a factorial design in a set of stream mesocosms to study the independent and combined effects of an anthropogenic stressor (sand sedimentation), local habitat (macrophytes, i.e., moss transplants), and enhanced dispersal (two levels: high vs. low) on organic matter retention, algal accrual rate, leaf decomposition, and macroinvertebrate community structure. Overall, all responses were simple additive effects with no interactions between treatments. Sand reduced algal accumulation, total invertebrate density, and density of a few individual taxa. Mosses reduced algal accrual rate and algae-grazing invertebrates, but enhanced organic matter retention and the number of detritus and filter feeders. Mosses also reduced macroinvertebrate diversity by increasing the dominance by a few taxa. Mosses reduced leaf mass loss, possibly because the organic matter retained by mosses provided an additional food source for leaf-shredding invertebrates and thus reduced shredder aggregation into leaf packs. The effect of mosses on macroinvertebrate communities and ecosystem functioning was distinct irrespective of the level of dispersal, suggesting strong environmental control of community structure. The strong environmental control of macroinvertebrate community composition even under enhanced dispersal suggests that re-establishing key habitat features, such as natural stream vegetation, could aid ecosystem recovery in boreal streams.