Here's a view of the foam under the floor on my bus:
I believe it's a factory-installed option because there isn't any mess on the wiring harness, hoses, etc. Looks to have been installed before those things were.
The rough appearance doesn't look like conventional spray application. It looks more like somebody had a hundred cans of Great Stuff and squirted a thousand little blobs side by side until the whole floor was covered.
Not that I think this is The One True Way; it's just a reference point of how a presumed factory-installed job was done.