Heteroatom-doped carbon materials can effectively activate H2O2 into •OH during the metal-free electro-Fenton (EF) process. However, information on bifunctional catalysts for the simultaneous generation and activation of H2O2 is scarce. In this study, O- and F-doped porous carbon cathode materials (PPCs) were prepared by the direct carbonization of polyvinylidene fluoride (PVDF) for sulfamerazine (SMR) removal in a metal-free EF process. The porous structure and chemical composition of the PPCs were regulated by the carbonization temperature. PPC-6 (carbonized at 600 °C) exhibited optimal electrocatalytic performance in terms of electrochemical H2O2 generation and activation owing to its high specific surface area, mesoporous structure, and optimum fractions of doped O and F. Excellent performance of the 2e− oxygen reduction reaction was found with an H2O2 selectivity of 93.5% and an average electron transfer number of 2.13. An H2O2 accumulative concentration of 103.9 mg/L and an SMR removal efficiency of 90.1% were achieved during the metal-free EF process. PPC-6 was able to stably remove SMR over five consecutive cycles, retaining 92.6% of its original performance. Quantitative structure-activity relationship analysis revealed that doped oxygen functional groups contributed substantially to H2O2 generation, and semi-ionic C–F bonds with high electronegativity were the cause of the activation of H2O2 to •OH. These findings suggest that the PVDF-derived carbonaceous catalysts are feasible and desirable for metal-free EF processes.