Osteoimmunology and immune microenvironments play an important role in bone tissue regeneration. Efficient and timely activation of pro-regenerative macrophages (M2) at the early stage is significant for new bone formation. In this study, an M2 phenotype-enabled multifunction hydrogel for efficient bone regeneration was developed. A layer of tannic acid (TA)-Mg2+ chelate networks were coated on black phosphorus (BP) nanosheets via a simple one-step method. TA-Mg2+ chelate on BP improves the stability of BP and enhances the osteogenesis and osteoimmunomodulation ability of BP. In addition, TA-Mg2+ modification also enhances interfacial bonding between BP nanosheets and the hydrogel matrix. Introducing BP@TA-Mg into methacrylate silk fibroin (SFMA) hydrogel can significantly enhance the mechanical capacity and the biological activity. The resulting SFMA–BP@TA-Mg (SFBTM) hydrogel exhibits the potential to polarize macrophages towards M2 phenotype, enhance angiogenesis in human umbilical vein endothelial cells (HUVECs), and promote osteogenic differentiation in bone marrow-derived mesenchymal stem cells (BMSCs). In vivo results demonstrate that the SFBTM hydrogel significantly enhances bone regeneration by modulating the immune microenvironment and macrophage phenotype, thereby promoting the vascularization and bone regeneration at the site of bone defects. This study provides a new perspective for critical-sized bone defect treatment through immunomodulation bioactive materials.