Although phylogenetic approaches are useful for providing insights into the processes underlying biodiversity patterns, the studies of microbial phylogenetic relatedness are rare, especially for elevational gradients. Using high-throughput pyrosequencing, we examined the biodiversity patterns for biofilm bacterial communities that were scraped from stream stones along an elevational gradient from 1820 to 4050 m in China. The patterns of bacterial species richness and phylogenetic diversity were hollow towards higher elevations. The bacterial communities consisted of closer relatives than expected and displayed increasing terminal phylogenetic clustering towards mountain top. The increasing phylogenetic clustering with elevation contrasts reports for macroorganisms that revealed phylogenetic overdispersion at low or intermediate elevations. Because water temperature showed the strongest correlation with phylogenetic relatedness (r2 = 0.516), the elevational pattern in the bacterial phylogenetic structure indicated that environmental filtering possibly due to lower temperature or more frequent temperature fluctuations increased towards higher elevations. Evidence supporting the environmental filtering on bacteria was also reflected by the orderly succession in the relative abundance of different bacterial phyla along the elevational gradient and in the high evenness of bacterial taxa at higher elevations. Overall, our results indicated that ecological processes possibly related to temperature may play a dominant role in structuring bacterial biodiversity along the elevational gradient.