Really good question, abcat

. In short, amphibians live in environments that harbor a lot of parasites, and they actively search for, and consume prey that is often already parasitized. Worms don't do this, which is one reason their infestation rate is much lower.
Amphibians and reptiles also have similarities that make them more suitable hosts for the same kinds of parasites (e.g. more robust digestive, circulatory, and respiratory systems, higher nutrient throughput, regulated pH levels, and more similar lifestyles than worms and reptiles), so many generalist parasites are able to live in both. Worms mostly conform to whatever environment they're in, which lowers the infestation and reproductive rates of any parasite that manages to colonize the worm.
That's a really quick and dirty overview, so send me a PM if this wasn't clear enough. Regards,
Rick