Why do Dogs Get Tapeworms Repeatedly?

My puppy wound up with tape worms, we treated him with medication to get rid of them. About a month later, he has them again…what…