Luckily you don't need to be infected by parasites to have a good immune system. What seems to work best is exposure to bacteria and viruses and fungi and parasites that don't infect humans. Things associated with other plants and animals. The immune system learns better from the things that it is effective at protecting you from than the things that outsmart it. So let's not bring back the human parasites.
“When Jasper Lawrence learned that hookworms might lessen the effects of his allergies, he set out on a unique mission: To travel to West Africa and purposefully become infected with the parasite” [1].
Would you rather ancient issues to which our bodies have apparently adapted or new issues we haven't yet had time to adapt to? I'm not sure on the answer myself but it doesn't appear as clear cut as no worms => no issues.
You don't have to give worms to everybody. If healthy adults would be better off with worms (and that's a big if) you could infect just adults. And then give them worming pills in late middle age when their immune systems are weakening.
Why select over generations when you can fix things directly? That's what medicine should be focusing on. Ways to safely edit our genes, metabolism and immune systems. Growing new body parts to replace broken ones.
All of this being used in practice might be more than 50 years away but there is no biological reason why it should be impossible. Just a lot of work, too much for any single company or government. It will take global coordination, massive investments and maybe the end of capitalism but I think we can pull it off as a civilization.