Dear Student,
The speed of sound is faster in solid materials and slower in liquids or gases because the velocity of a sound wave is affected by two properties of matter: the elastic properties and density.
For solids density is more than as compare to density of liquid and gases so speed of sound is maximum in solids.