Inflammation in the testes induced by infection and autoimmunity contributes significantly to male infertility, a public health issue. Current therapies using antibiotics and broad-spectrum anti-inflammatory drugs are ineffective against non-bacterial orchitis and induce side effects. This highlights the need to explore the pathogenesis of orchitis and develop alternative therapeutic strategies. In this study, we demonstrated that Gasdermin D (GSDMD) was activated in the testes during uropathogenic Escherichia coli (UPEC)-induced acute orchitis, and that GSDMD in macrophages induced inflammation and affected spermatogenesis during acute and chronic orchitis. In testicular macrophages, GSDMD promoted inflammation and antigen presentation, thereby enhancing the T-cell response after orchitis. Furthermore, the pharmacological inhibition of GSDMD alleviated the symptoms of UPEC-induced acute orchitis. Collectively, these findings provide the first demonstration of GSDMD’s role in driving orchitis and suggest that GSDMD may be a potential therapeutic target for treating orchitis.