That seems unlikely. Parasites are pretty good at infecting their hosts, and for a long time, there wasn't really a good way of getting rid of them once they were inside you.
If for long time there were no means to get rid of worms, how come the difference in intelligence that allowed to invent a cure for worms to be?
I see "worm free living" as a consequence of higher intelligence than vice versa.