Why spotlight passing is through meshes?

You have to set castShadow and receiveShadow of the shelf object to true. And the floor objects needs receiveShadow set to true.