There seems to be some confusion about what exactly sound proofing is, how it can be achieved, and what materials have which superpowers.
First - foam cannot be a wall all on its own; it can fill the same amount of space as a wall, but that does not make it a wall.
Second - What do I mean by foam? I mean those zig-zagging squares or the little pyramid matrices on squares. Like this: