I moved into a new house a few months ago, and had a leak from my (freestanding) tub. After taking out the drywall in the ceiling in the room below, I realized I had to lift the tub up to get to the drainage pipe. After doing so and turning it on its side, I saw all of this...stuff that was under the tub. It almost looks like some sort of foam that I assume was meant to be some sort of "cushion" when the tub was installed, but in looking at all of the tub installation instructions I can find, I don't find any mention of putting stuff like this (or any kind of cushioning) under the tub.
Also it's much denser than foam (but that could be caused by the leak completely soaking it). What is this, and when I reinstall the tub, do I have to do something like this again? Here's a photo: