Ulcerative colitis (UC) is a chronic inflammatory bowel disease with rising global incidence, imposing a significant burden on healthcare systems. Current treatments, including aminosalicylic acid derivatives like mesalazine, often face limitations such as low water-solubility and bioavailability. This study explores the development of a silk fibroin (SF)/oxidized glycyrrhizic acid (OG)/silk sericin-mesalazine (SM) hydrogel for rectal administration to enhance therapeutic efficacy. The SF/OG/SM hydrogel exhibits excellent adhesion, injectability, and gradual release of SM nanoparticles. It demonstrates high biocompatibility with negligible cytotoxicity and hemolysis, along with potent antioxidant and anti-inflammatory activities. In vivo studies reveal significant alleviation of UC symptoms, including reduced disease activity index (DAI), preserved colon length, and improved histological outcomes. The hydrogel suppresses the abundance of Escherichia coli and Enterococcus, while promoting the proliferation of Bifidobacterium and Lactobacillus, as well as the expression of tight junction proteins. Overall, the SF/OG/SM hydrogel presents a promising therapy for UC with enhanced therapeutic potential.