Historical cultural heritage sites are valuable for all of mankind, as they reflect the material and spiritual wealth of by nations, countries, or specific groups during the development of human civilization. The types and functions of microorganisms that form biofilms on the surfaces of architectural heritage sites influence measures to preserve and protect these sites. These microorganisms contribute to the biocorrosion of architectural heritage structures through the cycling of chemical elements. The ancient city wall of Shou County is a famous architectural and cultural heritage site from China’s Song Dynasty, and the protection and study of this site have substantial historical and cultural significance. In this study, we used metagenomics to study the microbial diversity and taxonomic composition of the Song Dynasty city wall in Shou County, a tangible example of Chinese cultural heritage. The study covered three main topics: (1) examining the distribution of bacteria in the biofilm on the surfaces of the Song Dynasty city wall in Shou County; (2) predicting the influence of bacteria involved in the C, N, and S cycles on the corrosion of the city wall via functional gene analysis; and (3) discussing cultural heritage site protection measures for biocorrosion-related bacteria to investigate the impact of biocorrosion on the Song Dynasty city wall in Shou County, a tangible example of Chinese cultural heritage. The study revealed that (1) the biofilm bacteria mainly belonged to Proteobacteria, Actinobacteria, Cyanobacteria, Bacteroidetes, and Firmicutes, which accounted for more than 70% of the total bacteria in the biofilms. The proportion of fungi in the microbial community of the well-preserved city wall was greater than that in the damaged city wall. The proportion of archaea was low—less than 1%. (2) According to the Shannon diversity index, the well-preserved portion of the ancient city wall had the highest diversity of bacteria, fungi, and archaea, and bacterial diversity on the good city wall was greater than that on the corroded city wall. (3) Bray–Curtis distances revealed that the genomes of the two good city walls were similar and that the genomes of the corroded city wall portions were similar. Researchers also detected human intestine-related bacteria in four locations on the city walls, with the proportion of these bacteria in the microbial community being greater on good city walls than on bad city walls. (4) KEGG functional analysis revealed that the energy metabolism and inorganic ion transport activities of the bacterial community on the corroded city wall were greater than those of the good city wall. (5) In the carbon cycle, the absence of active glycolysis, the ED pathway, and the TCA cycle played significant roles in the collapse of the east city wall. (6) The nitrogen cycling processes involved ammonia oxidation and nitrite reduction to nitrate. (7) In the sulfur cycle, researchers discovered a crucial differential functional gene, SoxY, which facilitates the conversion of thiosulfate to sulfate. This study suggests that, in the future, biological approaches can be used to help cultural heritage site protectors achieve targeted and precise protection of cultural relics through the use of microbial growth inhibition technology. The results of this study serve as a guide for the protection of cultural heritage sites in other parts of China and provide a useful supplement to research on the protection of world cultural heritage or architectural heritage sites.