The misuse of sulfadiazine (SFZ) has led to great hazard to the environment and human safety; therefore, a simple, rapid, and sensitive method to detect sulfadiazine is urgently needed. Herein, we report a simple fabrication method for rare earth vanadate samarium (SmV)-doped covalent organic framework COFTDBA-TTL nanocomposites (SmV/COFTDBA-TTL), which were used to construct a sulfadiazine (SFZ) electrochemical sensor. The synergistic effect arising from the combination of SmV and COFTDBA-TTL accelerates the charge transfer kinetics, along with the creation of more surface-active sites that benefit effective detection. Compared with other electrochemical sensors, this electrochemical sensor exhibits low detection limit (2.40 nM), wide linear range (7.32–12.0 μM), good reproducibility (RSD = 0.823%), and stability (RSD = 3.60%). It provides a novel method and theoretical basis for the application of rare earth COF-based electrochemical sensors to detect environmentally destructive pollutants.