This study devised a straightforward one-step approach that enabled simultaneous boron (B) doping and oxygen vacancies (OVs) production on Bi2Sn2O7 (BSO) (B-BSO-OV) quantum dots (QDs), optimizing the electrical structure of the photoelectrodes. Under light-emitting diode (LED) illumination and a low potential of 1.15 V, B-BSO-OV demonstrated effective and stable photoelectrocatalytic (PEC) degradation of sulfamethazine (SMT), achieving the first-order kinetic rate constant of 0.158 min−1. The surface electronic structure, the different factors influencing the PEC degradation of SMT, and the degradation mechanism were studied. Experimental studies have shown that B-BSO-OV exhibits strong visible light trapping ability, high electron transport ability, and superior PEC performance. DFT calculations show that the presence of OVs on BSO successfully reduces the band gap, controls the electrical structure, and accelerates charge transfer. This work sheds light on the synergistic effects of the electronic structure of B-doping and OVs in heterobimetallic oxide BSO under the PEC process and offers a promising approach for the design of photoelectrodes.