Styrofoam is a useful product. Packing peanuts will protect glassware from breakage when shipping. Packing peanuts are NOT, however, an accepted form of building material.
Even if your house has been fully inspected, hidden gems like these can be found within the walls of a home after closing. To find this issue, the buyer would need written permission from the seller to open the wall prior to close.