Biochar is a beneficial adsorbent for the treatment of organic pollutants in the environment. The association of oxygen functional groups and adsorption behaviors has not been well investigated. In this paper, the oxidation-modified biochar (O-BC) and the reduction-modified biochar (R-BCX) were prepared by Co2+/peroxymonosulfate chemical oxidation and high-temperature reduction, respectively. The modified biochars were used to remove sulfamethoxazole (SMX) from water, and the adsorption amounts of biochar followed the order of R-BC700 (14.66 mg·L−1) > O-BC (4.91 mg·L−1) > BC (0.16 mg·L−1). Additionally, the effects of water chemical conditions (i.e., ionic strength, solution pH and humic acid (HA) concentration) on the adsorption of SMX on biochar, were further investigated. Combining physical adsorption, X-ray electron spectroscopy, and zeta potentiometer characterization techniques, the effect of functional groups on the adsorption mechanism was further explored, revealing the importance of various oxygen functional groups for SMX adsorption. The results showed that C=O and C=C, resulting in π–π interaction, were in favor of the adsorption of SMX, while C-O was not conducive to the adsorption of SMX, due to the steric hindrance and the negative surface charge. Additionally, the hydrophobic effect of the biochar was also one of the adsorption mechanisms.