Elasticity is the property of substances by which they regain their original size and shape after deformation, when the deforming forces are removed.
There are various types of elasticity out of which one of them is the elasticity of shape. In this phenomenon, when the substances' shape is changed due to deforming forces, they regain their original shape after the deforming forces are removed.
A wave is a process in which the particles of the material-medium oscillate about their mean positions. These oscillations get constantly transfered to the next particle. This is how a wave travels along a medium.
A transverse wave is the one in which the medium's shape gets changed into a series of crests and troughs. After every crest, there is a trough and after every trough, there is the next crest.
For any oscillations to be sustained, a restoring force is mandatory, which brings back the particle to its mean position after being displaced. Sustained oscillations are necessary for waves to travel.
Since in a transverse wave, there is change of shape, the medium must posses the elasticity of shape.
Since liquids and gases don't have any fixed shape, there is no question of elasticity of shape.
Hence transverse mechanical waves cannot be propagated in them