It doesn't take too much water to make a white frothy milk mess in the gearbox. If you've got a good gob of grease packed in under the speedometer boot, and perhaps put a but of black electrical tape tight round the upper part of the boot to prevent water from finding a way in between the boot and the cable sheath, I'd suggest that you just aren't draining out ALL of the old "goop" from the gearbox, and what remained in last time just served to re-contaminate the new oil.
I haven't had to do this myself, but some have mentioned that the best way to "clean" out the old gearbox in severe cases is to take it out of the bike, fill it well with kerosene, and give it a good sloshing around/shaking to get any bits of the white goo, water, etc. that may be trapped in crevices or upper galleys washed out, then drain the mess out, carefully tilting the gearbox around to ensure that everything drains out. This might have to be repeated until one observes that what drains out is essentially "clean" kerosene. Then refill with gearbox oil of your choosing.