There are two sorts of resistance being talked about here.
The first is of worms to worming medicines. The second is of sheep to worms.
The reason that adult sheep are less bothered by worms than lambs are is that their immune system has had chance to build up against the worms. The same sort of thing as to why human kids get chicken pox, measles etc but adults tend not to. Specifically, it's immunoglobulin E and eosinophils that get involved in immunity to worms - in sheep and in us.
But when ewes are in lamb (or any other mammal is pregnant, same thing happens in humans) in order to avoid the immune system attacking the foetus, which is half 'foreign', the immune system is 'turned down'. So in-lamb ewes are more susceptible to worms - for the same reason pregnant women are more susceptible to things like Listeria, which most of the rest of the time, their immune systems would deal with.