There are two reasons.
1) It helps make them last longer ask dry, brittle latex comes off the glove easier than wet.
2) It helps the ball stick to the glove better.
See here for how that happens.
The latex foam has tiny holes, exactly like a kitchen sponge. The holes are small and brittle when dry, but when you get them wet, they expand and get bigger and softer (just like a kitchen sponge again). The tiny wholes then act as tenticles like an octopus has. Spit will do the job, but water is easier.
Read here about the power of the squeezy bottle.