The choice of material is pretty much up to you as generally it is not the material that is used that will impact the sound, rather the quality of the installation that will have the greatest impact.
Assuming your speaker has rubber feet for protecting the speaker and the shelf from being scratched.
If you feel the exterior of the speaker while the speaker is playing,especially if it is an economical speaker brand, you will feel some vibrations passed from the backward movement of the woofer through the speaker interior and then through the walls of the speaker.
Those little rubber feet serve to isolate the speaker.
If your speaker was not equiped with the little rubber feet, then visit HomeDepot. For about $2 you can buy a pack of rubber/nylon feet in either clear, black or white.
With the rubber feet installed, the only concern that you now have is to insure your installation will support the weight of the speaker, will remain rigid, and will not vibrate from the remainder of the sound vibrations that may be passed through the little rubber feet.
By the way, because metal has such a superior strength, most metal shelves are quite thin, and a thin shelf has greater resonance. Therefore, unless the metal shelf is reinforced to prevent vibrations, and is rigidly mounted, glass or a dense wood product is prefered.