Soil contamination with petroleum significantly threatens the ecological equilibrium and human health. In this context, aerobic co-composting of waste heavy oil with agricultural wastes was performed in the present study to remediate petroleum pollutants through four treatments: CK (control), T1 (petroleum pollutant), T2 (petroleum pollutant with bentonite), and T3 (petroleum pollutant with humic acid-modified bentonite). Comprehensive analyses were conducted to determine the physicochemical parameters, enzymatic activities, removal of petroleum pollutants, microbial community structure, and water-extractable organic matter in different composting systems. Structural equation modeling was employed to identify the key factors influencing the removal of petroleum pollutants. According to the results, petroleum pollutant removal percentages of 44.94%, 79.09%, and 79.67% could be achieved with T1, T2, and T3, respectively. In addition, the activities of polyphenol oxidase (51.21 U/g) and catalase (367.91 U/g), which are the enzymes related to petroleum hydrocarbon degradation, were the highest in T3. Moreover, bentonite addition to the treatment increased the nitrate nitrogen storage in the compost from 10.95 mg/kg in T1 to 18.63 and 17.41 mg/kg in T2 and T3, respectively. Humic acid-modified bentonite could enhance the degree of compost humification, thereby leading to a higher-quality compost product. Collectively, these findings established bentonite addition as an efficient approach to enhance the compost remediation of petroleum pollutants.