Composite gel spheres (SA-BC) were prepared by using sodium alginate (SA) as a carrier and adding peanut shell biochar, and their preparation conditions were optimized to evaluate their effectiveness in removing the ofloxacin (OFX) from water. In addition, antibiotic contamination in Chinese urban waters was investigated. The results showed that a variety of antibiotic pollution existed in natural water bodies, among which SA-BC performed excellently in removing OFX from water, with a removal rate of 70.72%, and maintained good adsorption performance after four cycles of use. The experiments demonstrated the general applicability and practical application potential of SA-BC in dynamic adsorption, resistance to ionic interference and removal of heavy metals from water. The fitting results of the adsorption data showed that the adsorption process of OFX by SA-BC was consistent with the Langmuir isothermal model and the pseudo-second-order kinetic model. Further analysis showed that three main adsorption mechanisms existed in the adsorption of OFX by SA-BC, namely, the role of surface functional groups, π-π electron donor-acceptor (EDA) interactions, and electrostatic attraction.