The present study investigated the value of human β-defensin 3 (HBD-3) in adjusting the immunity and inflammatory response of T lymphocytes in the body after knee replacement. Sixty-four cases of knee replacement patients were successively selected and randomly divided into the control group and the observation group each with 32 cases. Once a day, for 7 days, patients in the control group were injected with placebo saline solution in the articular cavity. Levels of Th1 and/Th2, interleukin (IL)-2 and IL-10, tumor necrosis factor (TNF)-α, toll-like receptor (TLR)-4, and alkaline phosphatase (ALP) were compared one month later, and implant infection rates were compared within 1-year follow-up. Compared with patients in the control group, the levels of Th1 and Th1/Th2 in the observation group significantly increased, yet their Th2 decreased. The levels of IL-2 and TNF-α were also observed to be significantly elevated, yet IL-10 decreased. Furthermore, their TLR-4 and ALP levels were significantly higher. Three cases of implant-related infection occurred in the control group and 1 case in the observation group. In conclusion, HBD-3 could adjust the immunity and inflammatory response of cells in the body after knee replacement, possibly playing an important role in implant-related infection.