In brief S-palmitoylation is a key protein modification, but the role of ZDHHC5 in male fertility was unknown. This study shows ZDHHC5 loss impairs spermatogenesis, causing male infertility, and identifies ZDHHC5 as a key regulator, offering new insights into infertility mechanisms. Abstract S-palmitoylation is a reversible post-translational modification critical for protein localization and function. ZDHHC5, a member of the ZDHHC family of palmitoyltransferases, has well-established roles in cardiovascular, neural, and metabolic systems, but its function in male reproduction remains unclear. To investigate this, we generated Zdhhc5 -knockout (KO) mice using CRISPR/Cas9 and found that male KO mice exhibited complete infertility. Phenotypic analysis revealed significantly reduced testis-to-body weight ratios, decreased sperm count and motility, and increased sperm malformations, including abnormal heads and folded tails. Histological and ultrastructural analyses demonstrated defective spermatogenesis, with aberrant retention of sperm during seminiferous tubule maturation and abnormal membranous structures in sperm. Immunofluorescence showed that ZDHHC5 predominantly localizes to the Golgi apparatus of round spermatids (steps 2–8) without affecting Golgi morphology or acrosome biogenesis. While in vitro fertilization with Zdhhc5 −/− sperm failed, intracytoplasmic sperm injection (ICSI) successfully rescued male infertility, suggesting functional disruption at the protein modification level rather than genetic material impairment. We also found that ZDHHC5 mediates IFT81 palmitoylation, regulates IFT81 in round spermatids, and links to sperm tail malformations. These findings establish ZDHHC5, a palmitoyltransferase, as a pivotal regulator of spermatogenesis, thereby yielding new insights into the molecular mechanisms underlying male infertility.