Iron (Fe) is widely recognized for its effectiveness in the Fenton reaction and is commonly used in wastewater treatment. However, exploring other metals in similar Fenton-like reactions has been relatively limited. FeCo alloy nanoparticles (NPs), anchored on nitrogen-doped mesoporous carbon spheres (FeCo/NMCS), have been effectively synthesized and used as a Fenton-like catalyst in wastewater treatment under alkaline conditions. The NMCS exhibited spherical with an average diameter of 488.1 nm, while the FeCo alloy NPs, uniformly distributed over the NMCS, had an average diameter of 8.2 nm. The mesopores served as anchoring points for the NiCo alloy NPs, effectively preventing their possible agglomeration. The NMCS was composed of 3.91 wt% nitrogen. With 30 mg of FeCo/NMCS and 25 mM H2O2, more than 92% of tetracycline hydrochloride (TC) was degraded within 35 min at pH levels 7, 9, and 11. The remarkable degradation rate was attributed to the dual active sites present in the FeCo alloys. The rapid degradation of TC, even at pH 11, indicates the potential of FeCo/NMCS as a valuable solution for wastewater treatment under alkaline conditions. Industrial reactive (Y145, R195, B222A) and disperse dyes (O30, R167, B79) with a concentration of 10 ppm were degraded within 20 min when using 10 mg of the FeCo/NMCS catalyst and 25 mM H2O2 at pH 9. After five consecutive TC degradation cycles at pH 7 and 9, the FeCo/NMCS demonstrated consistent performance, emphasizing its reusability. FeCo/NMCS provides a promising solution to pollution control and wastewater treatment with stability, superior catalytic activity, magnetic separability, and recyclability.