Notice the contrast of examples: for the SMT part, leads are short and stiff, and a rigid resin is required to further secure it.
For a THT part, the leads have some length, so the part can flex against the board. It might also have enough pins that it's rather well tied into the board, so the board itself flexes more (a potential hazard for nearby ceramic chip caps, say!). Consider a big ETD39 laying flat with dozens of pins, and now compare to the case of something floppy, like a THT electrolytic capacitor. The former might not need anything, while the latter might benefit most from a softer resin, as the peak deflection could still be within the elastic range (little/no lead fatigue), whereas a very rigid compound might.. tear the capacitor's skin away, or something?
Maybe that's not the best contrasting example, I've certainly seen caps glued to boards with fairly stiff glue, and at that, mainly because the layer was thin. The skin / jacket is usually pretty tough by itself. But you can imagine components that can't be pulled just any which way, that might be damaged if glued improperly and subjected to mechanical shock.
Conversely, soft resin on a rigid component, just doesn't do much. It's adding a large inductor in parallel with an already small one, it does nothing. (Note that electrical analogies are no accident, there is a perfect equivalence between inductance and mass, resistance and, erm, dashpot, and capacitance and spring. Mechanical systems are less often reasonable to treat as lumped element equivalents, because of the fairly low speed of sound and many degrees of freedom, but it can still be illustrative of some cases.)
Tim