The leaching and vertical migration risks of antibiotic resistance genes (ARGs) from fertilized soil to groundwater poses a significant threat to ecological and public safety. Insect fertilizer, particularly black soldier fly organic fertilizer (BOF), renowned for its minimal antibiotic resistance, emerge as a promising alternative for sustainable agricultural fertilization. This study employs soil-column leaching experiments to evaluate the impact of BOF on the leaching behavior of ARGs. Our results reveal that BOF significantly reduces the leaching risks of ARGs by 22.1% - 49.3% compared to control organic fertilizer (COF). Moreover, BOF promotes the leaching of beneficial Bacillus and, according to random forest analysis, is the most important factor in predicting ARG profiles (3.02 % increase in the MSE). Further network analysis and mantel tests suggest that enhanced nitrogen metabolism in BOF leachates could foster Bacillus biofilm formation, thereby countering antibiotic-resistant bacteria (ARB) and mitigating antibiotic resistance. In addition, linear regression analysis revealed that Bacillus biofilm-associated genes pgaD (biofilm PGA synthesis protein), slrR (biofilm formation regulator), and kpsC (capsular polysaccharide export protein) were identified as pivotal in the elimination of ARGs, which can serve as effective indicators for assessing antibiotic resistance in groundwater. Collectively, this study demonstrates that BOF as an environmentally friendly fertilizer could markedly reduce the vertical migration risks of ARGs and proposes Bacillus biofilm formation related genes as reliable indicators for monitoring antibiotic resistance in groundwater.