Recently, studies have reported a correlation that individuals with diabetes show an increased risk of developing Alzheimer’s disease (AD). Mulberry leaves, serving as both a traditional medicinal herb and a food source, exhibit significant hypoglycemic and antioxidative properties. The flavonoid compounds in mulberry leaf offer therapeutic effects for relieving diabetic symptoms and providing neuroprotection. However, the mechanisms of this effect have not been fully elucidated. This investigation aimed to investigate the combined effects of specific mulberry leaf flavonoids (kaempferol, quercetin, rhamnocitrin, tetramethoxyluteolin, and norartocarpetin) on both type 2 diabetes mellitus (T2DM) and AD. Additionally, the role of the gut microbiota in these two diseases’ treatment was studied. Using network pharmacology, we investigated the potential mechanisms of flavonoids in mulberry leaves, combined with gut microbiota, in combating AD and T2DM. In addition, we identified protein tyrosine phosphatase 1B (PTP1B) as a key target for kaempferol in these two diseases. Molecular docking and molecular dynamics simulations showed that kaempferol has the potential to inhibit PTP1B for indirect treatment of AD, which was proven by measuring the IC50 of kaempferol (279.23 μM). The cell experiment also confirmed the dose-dependent effect of kaempferol on the phosphorylation of total cellular protein in HepG2 cells. This research supports the concept of food–medicine homology and broadens the range of medical treatments for diabetes and AD, highlighting the prospect of integrating traditional herbal remedies with modern medical research.