The oxygen reduction reaction (ORR) is an important reaction in fuel cells and metal air batteries. The reaction is affected by slow kinetics and the use of high-priced and resource-scarce platinum-based catalysts. Therefore, there is an urgent need to develop cost-effective nonprecious metal catalysts for use in the ORR to replace Pt-based catalysts. In this study, we used two-dimensional covalent organic frameworks (recorded as TF-COFs) as precursors to produce a metal-free nitrogen and fluorine-co-doped porous carbon catalyst (recorded as TF-800, TF-900, TF-1000, and TF-1100). TF-1000 had a high initial potential (0.90 V) and half-wave potential (0.83 V) in an alkaline medium, indicating good catalytic activity. In addition, the ORR stability of TF-1000 was better than that of commercial Pt/C (20%). This is mainly because the porous carbon catalyst has a high specific surface area, and the nitrogen and fluorine atoms in it have good dispersion and synergistic effects on the polarization of adjacent carbon atoms. TF-1000 also shows excellent performance in zinc-air batteries. In the TF-1000 based zinc-air batteries, excellent battery performance was observed: the peak power density reached 216.66 mW·cm–2, the specific capacity reached 752.86 mAh·g–1 at 10 mA·cm–2, and the long-term charge–discharge stability was demonstrated. This work provides inspiration for new strategies to prepare future ORR catalysts.