Moss-microbial biofilm is an important topic for the biodeterioration of sandstone heritages. However, the processes that biofilms colonize and erode sandstone heritages should be better defined. We divided mosses into three strata perpendicular to the sandstone face in the direction from the atmosphere to the sandstone surface (the upper layer, the middle layer, and the lower layer) to explore the mechanisms involved. The results showed that the bacteria in various layers of moss exhibited a distinct layered pattern of nutrient strategies. The bacteria in the upper layer were mostly photoautotrophic (e.g., Cyanobacteria, WPS-2, etc.) and methylotrophic bacteria (e.g., Methylobacterium-Methylorubrum, Sphingomonas, etc.). The bacteria in the lower layer were primarily heterotrophic as special Actinobacteria with the ability of weathering (e.g., Actinomycetospora, Nocardioides, etc.). Particularly, the potential acid condition in the lower layer would promote the growth of acidophilic bacteria (e.g., Acidipila, Acidiphilium, etc.) and acidophilic iron-reducing bacteria (e.g., Acidiphilium, Acidicaldus, etc.), which deteriorate the alkaline cement and ferric oxides. Furthermore, nucleotide sequences associated with the Calvin-Benson-Bassham cycle, methanol utilization (methanol dehydrogenase), nitrogen fixation (nitrogenase), and ammonia oxidation (ammonia monooxygenase) were more prevalent in the upper layer of bacterial communities. The nucleotide sequences related to the reductive tricarboxylic acid cycle, reduced acetyl-CoA pathway, decomposition of organic carbon (β-1,4-glucosidase), and organic nitrogen (β-N-acetyl glucosaminidase) were more abundant in the lower layer. Therefore, in addition to the damage to the moss itself, we should pay more attention to the microorganisms that live in symbiosis with it. Our study shows that the strategy of stratified colonization of microorganisms would supply the nutrients available for moss-microbial biofilm, the formation of which would in turn deteriorate sandstone heritages.