If this is what you've heard from someone or somewhere then the information is wrong and whomever you've heard it from has only half the knowledge of what he/she is saying. Closed-cell spray foam is resistant to moisture contact as well and is very well suited to be used on the exterior of buildings as a secondary layer as the cladding or as the only exterior layer with a finished coating. Using closed-cell spray foam on the exterior is a cost-effective way to achieve this requirement. For a matter of fact when used in this configuration closed cell spray foam meets the requirements for vapour, air, moisture, and thermal bypass control. This is quite often referred to as the 'perfect wall' or four barrier system. This is possible as it's designed to be used in all climatic conditions with little to absolutely no modifications.
Closed-cell spray foam roofing systems offer heightened sustainability and durability along with moisture resistance and energy conservation. Closed-cell spray foam is a popular component of reflecting roofs to underlay the green or vegetative roofs.
It's also quite uniquely suited for roofs with unusual shapes and is used for retrofitting buildings to the current ASHRAE standards. In the use of commercial application closed cell spray foam helps label air barrier challenges that result from mechanically fastening roofing systems. While a roof barrier membrane system can be considered to be an air barrier material it's necessary to know that only fully continuous and adhered are effective as part of the entire building envelope air barrier system.
Whilst that's all the knowledge I can share with you, you can learn more from glass wool insulation on the internet.