There's two ways to take it:
1. He got it after returning to Earth and it was of earthly origin, considering it was common enough for a cure to be tested.
2. He got it on Yardrat. Staying roughly a year on an alien planet is ample time to pick up some disease from a completely alien environment. If including non-canon material, Bulma developed a counter to the Destron Gas with very limited knowledge of it in the Hatchiyack OVA remake, so her being able to make a medicine from just one case wouldn't be a stretch.
I think the bigger question to be asked is why did the main timeline Goku get sick far later? I'd say some possible reasons for that could include Goku's greater level of training and cultivation of Ki could've staved off the illness for longer, or it could be from him arguably returning sooner in Trunks' timeline (but that's a topic for a different thread).