That's really going to depend on the structure of the material. Density is just one variable among many.
The name of the game here is certainly energy dissipation. Foams are good to that end because they scatter incoming waves into many directions; they also absorb some of that energy. The scattered wave will have less energy than the incoming wave and lose its coherence. Carpets and similar materials will also work well in this capacity.
Dense materials can indeed absorb sound energy (as noted, for example, in those heavy curtains in the site linked above), but they have to be sufficiently dense and heavy that they don't simply re-transmit the sound energy. Those particular items may have done more to block the sound (and reflect it back towards the source) than to absorb it.
I'd recommend against using the sides of the case as sound dampers with a heavy material. They generally aren't constructed very well (very thin), and I see the possibility that the sound will transmit through the dense material to the thin case, which will then vibrate and further-propogate the sound, although at a different frequency. (It would be better to mechanically isolate the dense material from the sides of the case.)
I'd absolutely recommend against using lead as Soy brought up originally.
First, it's extremely conductive. (think solder) This won't be good for your computer.
Second, it's highly toxic and causes brain damage in people of all ages and developmental disorders in born and unborn children. (lead paint isn't used in homes anyomore for this reason)
See also the
CDC lead fact sheet (relating mostly to childhood lead poisoning). Also,
here is some information on adult lead poisoning. I'm not sure at the moment if lead exposure is permanent. (For example, once mercury enters your system, it doesn't leave.)
Third, it's a very soft material, which means that small particles will readily come loose and enter the environment. (You won't necessarily see them, either.) With the constant airflow through your case exiting out the back, you'll be carrying this lead particulate matter into your living space. So expect exposure to lead dust if you use it in your computer. (And expect that conductive lead dust to make it into your PSU.)
-- Paul