The repair of critical-sized bone defects remains a major challenge for clinical orthopedic surgery. Here, we develop a surface biofunctionalized three-dimensional (3D) porous polyether-ether-ketone (PEEK) scaffold that can simultaneously promote osteogenesis and regulate macrophage polarization. The scaffold is created using polydopamine (PDA)-assisted immobilization of silk fibroin (SF) and the electrostatic self-assembly of nanocrystalline hydroxyapatite (nano-HA) on a 3D-printed porous PEEK scaffold. The SF/nano-HA functionalized surface provides a bone-like microenvironment for osteoblastic cells' adhesion, proliferation, mineralization and osteogenic differentiation. Moreover, the biofunctionalized surface can effectively drive macrophages polarization from the pro-inflammatory M1 phenotype to the anti-inflammatory M2 phenotype. Integrin β1-specific cell-matrix binding and the activation of Ca2+ receptor-mediated signaling pathway play critical roles in the regulation of macrophage polarization. Compared with the as-printed scaffold, the SF/nano-HA functionalized porous PEEK scaffold induces minimal inflammatory response, enhanced angiogenesis, and substantial new bone formation, resulting in improved osseointegration in vivo. This study not only develops a promising candidate for bone repair but also demonstrates a facile surface biofunctionalization strategy for orthopedic implants to improve osseointegration by stimulating osteogenesis and regulating immunity.