Pus is white primarily due to the presence of white blood cells.
Pus is a visual sign that your body is fighting an infection. It's essentially a collection of dead neutrophils (a type of white blood cell), bacteria, and cellular debris that accumulate at the site of infection. The high concentration of these white blood cells is what gives pus its characteristic whitish-yellow, or sometimes even greenish, color. As the reference states, pus is a sign of infection, consisting of white blood cells and dead bacteria, indicating the body's immune response to fight off invading microorganisms.
In summary, the white color of pus directly reflects the body's immune system at work, specifically the accumulation of white blood cells combating an infection.