In order for a square wave to travel through a material, it would need to allow for infinitely high frequencies (see the animation on wikipedia[0] for a visual demonstation). The lower the maximum frequency possible, the more every wave will resemble a sine wave because it's the most basic shape: any non-smooth wave has higher-frequency components to give it its shape. Filter out those higher frequencies, and you're left with the basic smooth sine wave again.
A stiff material tends to dampen high frequencies, simply because it cannot deform fast enough to follow the wave's shape. In a way, the medium acts as a low-pass filter; compare, fow example, how fast you can clap your hands in air vs in water: the stiffness of water slows down your movements so you cannot reach high clapping frequencies.
[0] https://en.wikipedia.org/wiki/Square_wave?useskin=timeless#C...