The impairment of the immune system by fluoride is a public health concern worldwide, yet the underlying mechanism is unclear. Both riboflavin and IL-17A are closely related to immune function and regulate the testicular toxicity of fluoride. However, whether riboflavin or IL-17A is involved in fluoride-induced immunotoxicity is unknown. Here, we first established a male ICR mouse model by treating mice with sodium fluoride (NaF) (100 mg/L) via the drinking water for 91 days. The results showed that fluoride increased the expression of the proinflammatory factors IL-1β and IL-17A, which led to splenic inflammation and morphological injury. Moreover, the expression levels of the riboflavin transporters SLC52A2 and SLC52A3; the transformation-related enzymes RFK and FLAD1; and the key mitochondrial functional determinants SDH, COX, and ATP in the spleen were measured via real-time PCR, Western blotting, and ELISA. The results revealed that fluoride disrupted riboflavin transport, transformation, metabolism, and mitochondrial function. Furthermore, wild-type (WT) and IL-17A knockout (IL-17A-/-) C57BL/6 J male mice of the same age were treated with NaF (24 mg/kg·bw, equivalent to 100 mg/L) and/or riboflavin sodium phosphate (5 mg/kg·bw) via gavage for 91 days. Similar parameters were evaluated as above. The results confirmed that fluoride increased riboflavin metabolism through RFK but not through FLAD1. Fluoride also affected mitochondrial function and activated neutrophils (marked with Ly6g) and macrophages (marked with CD68) in the spleen. Interestingly, IL-17A partly mediated fluoride-induced riboflavin metabolism disorder and immunotoxicity in the spleen. This work not only reveals a novel toxic mechanism for fluoride but also provides new clues for exploring the physiological function of riboflavin and for diagnosing and treating the toxic effects of fluoride in the environment.