FCD, it depends on the type of expanding foam you use.
Some folks use the same type of foam used for sealing window openings around the window frame or other air leaks in the home.
Others use the foam sprayed in houses and other buildings as insulation.
Insulating foam can be quite rigid and add strength as well as reducing sound. All of them reduce sound to some extent.
I use the same foam that comes in the "rattle cans" for replacing the insulation/sound abbreviating qualities in vehicles. It's available in big box as well as specialty auto stores and is reasonably cheap.
It seems to add more strength (not much) than household expanding foams and is more like the rigid Styrofoam insulation sheathing used on the outside walls of houses before installing the finishing material.
I like this type because it doesn't expand as much as others and if you need to add a sling swivel, you can drill out a hole, fill it with epoxy, which forms to the hole as well as binds to the stock, then attach your sling swivel studs.
Noise dampening is better, because this type of foam is denser and developed for the purpose as well as insulating.