S-waves are shear waves, which move particles perpendicular to their direction of propagation. They can propagate through solid rocks because these rocks have enough shear strength. The shear strength is one of the forces that hold the rock together, preventing it from falling into pieces. Liquids lack shear strength. This is the reason why, if you take a glass of water and suddenly remove the glass, the water will not keep its shape. In fact, it is just a matter of rigidity: S-waves need a medium that is rigid enough for them to propagate. This is why S-waves cannot propagate through liquids.