In the construction industry, building envelopes are designed and made in such a way that there is no condensation of water vapor on the internal surface of the envelope, as this would cause numerous operational problems for the building.
Water vapor condensation could occur, for example, when in winter the water vapor from inside the building moves towards the thermal insulation and reaches the dew point temperature somewhere in it.
The probability of such a situation occurring can be easily eliminated by protecting the foam with a vapor barrier on the inside of the roof.
Remember that it is not the building envelope that ventilates the building and removes water vapor from the rooms (walls and roof are responsible for 1-3% of moisture removal), but the ventilation system.
In buildings equipped with a ventilation system with heat recovery, in addition to reducing heat loss, the device also eliminates all problems caused by moisture from inside the house.
However, even if the building does not have a mechanical air exchanger, a well-functioning gravity ventilation manages to exchange the air in the rooms before the water vapor in the humid air reaches the deeper layers of the envelope.
This is why, in order to increase the diffusion resistance, application of a vapor barrier is recommended before installing plasterboards.
Even if, as a result of random events, water vapor, e.g. from the inside, got inside the roof, the foam would slow down its penetration through the insulation layer to such an extent that, with appropriate thicknesses, it would prevent the dew point from occurring because the water vapor would not suddenly cool down.
Polyurethane foam is a vapor-permeable material, which is why even if it gets exposed to moisture it will allow water vapor to permeate outside the building, making the roof structure completely safe.
It is also worth mentioning that, in contrast to traditional insulating materials, when the foam gets damp, mold does not appear on it and it does not become a breeding ground for microorganisms.
Even in the event of direct and prolonged exposure to water, it will dry completely and retain its original properties.