The development of industrial mining has resulted in a large amount of Cd and Pb polluting the soil in mining areas, and leads to adverse health effects on the life of both plants and animals. Here, a soft template method was conducted to prepare hydrothermal carbon (HC) with regular morphology, which assisted with Bacillus pasteurii to induce calcite precipitation for decontamination of mining soil. Soil remediation experiments over 30 days of remediation with an HC microbial agent (HCMA) resulted in 89.4% and 87.8% decrease in the amount of leached Cd and Pb, respectively. The content of exchangeable Cd and Pb decreased by 76.1% and 81.0%, respectively. At the same time, soil fertility significantly improved. The electrostatic potential and surface charge distribution of extracellular polymeric substances (EPS) and sodium citrate (NaCit) were analyzed using DFT simulations, their nucleophilic and electrophilic regions were determined, and the nucleation mechanism was determined. The DFT results indicated that the oxygen-containing groups of EPS and NaCit had strong negative electrostatic potential and electronegativity, which could cause Cd2+, Pb2+, and Ca2+ to aggregate on their surfaces. They also combined with CO32− produced by urease during the decomposition of urea, resulting in Cd2+ and Pb2+ being encapsulated by calcium carbonate to form a coprecipitate. X-ray diffraction analyses revealed that the precipitate was mainly calcite calcium carbonate, which is more stable and less prone to secondary leaching of HMs. The gathered data prove the significant role of HCMA in remediation of mining soil contaminated with Cd and Pb.