Celastrol, the primary constituent of Tripterygium wilfordii, has demonstrated neuroprotective properties in rats with dementia by reducing inflammation. A high-fat diet and streptozotocin injection were utilized to establish a diabetic rat model, which was then employed to investigate the possible protective effect of celastrol against the development of diabetes-induced learning and memory deficits. Afterwards, the experimental animals received a dose of celastrol by gavage (4 mg/kg/d). An animal study showed that celastrol enhanced insulin sensitivity and glucose tolerance in diabetic rats. In the Morris water maze test, rats with diabetes performed poorly in terms of spatial learning and memory; treatment with celastrol improved these outcomes. Additionally, administration of celastrol downregulated the expression of inflammatory-related proteins (NF-κB, IKKα, TNF-α, IL-1β, and IL-6) and greatly reduced the generation of Aβ in the diabetic hippocampus tissue. Moreover, the insulin signaling pathway-related proteins PI3K, AKT, and GSK-3β were significantly upregulated in diabetic rats after celastrol was administered. Also, celastrol prevented damage to the brain structures and increased the synthesis of synaptic proteins like PSD-95 and SYT1. In conclusion, celastrol exerts a neuroprotective effect by modulating the insulin signaling system and reducing inflammatory responses, which helps to ameliorate the cognitive impairment associated with diabetes.