In the experiment, the morphology of heavy metals (Pb, Cr, Cd, and Ni, HMs) was characterized using flame atomic absorption spectroscopy. In addition, Fourier transform infrared spectroscopy (FTIR) and three-dimensional excitation-emission matrix fluorescence spectroscopy (3D-EEM) were used to characterize the correlation between environmental factors and metal morphology in the rotting compost from several angles. The results showed that the humus treated with wood vinegar solution had a high degree of humification and rich aromatic structure. FTIR spectroscopy confirmed that the degree of humus aromatization gradually increased during the composting process, which enhanced the complexation of humus (HS) with HMs but had less effect on Ni. In addition, the optimum concentration of wood vinegar (WV) was determined to be 1.75%. The results of the study showed that in the Pb passivation treatment group, the proportion of soluble (Red) and exchangeable states (Exc) converted to oxidized (Oxi) and residual states (Res) was 8%, 14%, 6%, 1%, and 12% in the CK, T1, T2, T3, and T4 treatment groups, respectively; in the Cr passivation treatment group, the proportion of Cr-Red and Cr-Exc converted to oxidized and residual states was 31%, 33%, 25%, 29%, and 25%; in the Cd passivation treatment group, the proportions of Cd-Red and Cd-Exc converted to oxidized and residual states were 5%, 15%, 4%, 9%, and 11%, respectively; whereas the Ni treatment group did not show any significant passivation effect. The proportion of Pb-Oxi was relatively stable, Cr-Oxi was converted to Cr-Res, whereas Cd showed the conversion of Cd-Oxi to Cd-Exc. SUVA254 and SUVA280 showed significant positive correlations with Pb-Res, Cr-Res and Ni-Res, and significant positive correlations with moisture content (MC); whereas MC was significantly negatively correlated with each form of HMs. Total potassium (TK), total nitrogen (TN), and both carbon (TOC) were negatively correlated with Pb-Res and Pb-Exc. Structural equation modeling verified the relationship between environmental factors and HMs, and the composting results showed that the addition of biochar (BC) and a higher percentage of WV could increase compost decomposition and passivate HMs to improve its agronomic function.