Closed cell spray can take water for quite some time and not be adversely affected. We have actually had a basement that we spray foamed with 3″ of closed cell foam get completely flooded for over 3 weeks. When the water receded we did a absorption test and adhesion test. The foam was still dry and when we dug through it to the concrete substrate it was still fully adhered. The home owner cleaned out the house and we sprayed the remaining portions of the basement.
It is possible for closed cell spray foam to take water on in the case of abnormal high humidity for extended periods of time, like months. In cases where high humidity is an issue we recommend an HRV or heat recover ventilator commonly know as an air to air exchanger. How they work is they remove the stale humid air from inside a building replacing it with fresh drier air from the outside. The heat recovery unit heats the incoming air with the outgoing air in the winter without mixing the two so the building get fresh dry air with minimal energy loss. We recommended a humidity level range of 35% to 45%. If the foam does take on water it is an easy fix. Just get the building to normal humidity levels and the water will perm out of the foam over time.