The correct response is: They have different rigidities.
The speed of sound in a material is influenced by the material's density and rigidity (or elastic modulus). Diamond, being a much more rigid material than wood, allows sound to travel faster through it.