Steroid hormones play an essential role in many reproductive processes of vertebrates. Previous studies revealed that teleost-specific Cyp17a2 (cytochrome P450 family 17 subfamily a 2) might be required for the production of cortisol in the head-kidney and 17α,20β-dihydroxy-4-pregnen-3-one (DHP) in ovary during oocyte maturation. However, the role of Cyp17a2 in male reproduction remains to be largely unknown. The aim of this study was to explore the essentiality of cyp17a2 gene in male steroidogenesis, spermatogenesis, and male fertility. A homozygous mutation line of cyp17a2 gene was constructed in tilapia by CRISPR/Cas9 gene editing technology. The expression level of germ cell and meiosis-related genes and steroidogenic enzymes were detected by qRT-PCR, IHC, and Western blotting. EIA and LC-MS/MS assays were used to measure the steroid production levels. And sperm quality was examined by Sperm Quality Analyzer software. In this study, cyp17a2 gene mutation resulted in the significant decline of serum DHP and cortisol levels. On the contrary, significant increases in intermediate products of cortisol and DHP were found in cyp17a2-/- male fish. The deficiency of cyp17a2 led to the arrest of meiotic initiation in male fish revealing as the reduction of the expression of germ cell-related genes (vasa, piwil, oct4) and meiosis-related genes (spo11 and sycp3) by 90 dah. Afterwards, spermatogenesis was gradually recovered with the development of testis in cyp17a2-/- males, but it showed a lower sperm motility and reduced fertility compared to cyp17a2+/+ XY fish. Deletion of cyp17a2 led to the abnormal upregulation of steroidogenic enzymes for cortisol production in the head-kidney. Moreover, unaltered serum androgens and estrogens, as well as unchanged related steroidogenic enzymes were found in the testis of cyp17a2-/- male fish. This study proved that, for the fist time, Cyp17a2 is indispensable for cortisol and DHP production, and cyp17a2 deficiency associated curtailed meiotic initiation and subfertility suggesting the essentiality of DHP and cortisol in the male fertility of fish.