Adding my $0.02 and attempting to simplify a few things for those who just want a path that makes sense, without charts graphs, numbers, and who might be inundated with Google AI conflicting information on what to do about ATTICS, a common space for the spray foam discussion. 1st: what follows is about "humid - subtropical" zones and 2nd: "new builds". This applies say ... central Alabama on a lake. What the sub-climate is matters (not entirely but matters). I am in the engineering/science space so while I like opinion, common sense science wins the day on this side. Below is an attempt to make the case for Open Cell Foam for this use case.
Some fundamental truths. "Traditional" has historically meant interior structural elements and insulation open to outside cold, hot, dry and or moist and all this is. "Sealed" is the opposite, comes with more choices, options, selections thus becomes complicated if diving into the details but, it does not have to be complicated in decision-making.
A. Water is managed and controlled on the outside of the structure (NOT) the inside. If attempting to control water from the inside, stop here because that is something different.
B. Seal the structure up tight (and properly for the building materials used) and water stays where it belongs which outside the structure. Good start is two layers of membrane and a tightly installed quality sheathing, quality roofing contractor, quality shingles.
C. Moisture (talking diffusion now which is microscopic particles) is not the primary discussion here but one can understandably get frustrated with an encyclopedia of material scientists on 1% of the issue and avoiding the 99%.
D. Moving to the inside of the structure, managing and controlling temperature, humidity for either or both comfort cooling or asset protection, comes down to (for the humid-subtropical) 90%(+) moisture drive from outside to inside and 10%(-) moisture drive from inside to outside. Moisture drive for this $0.02 means high moisture seeks low moisture and let's leave that as is.
E. If the structure is not sealed from water from the outside and this includes SEALING OUT WARM MOIST AIR, then go back to "A" and "B" above.
F. Now we are inside, for this case of new construction, in a humid-subtropical zone, use OPEN CELL FOAM (OCF) to insulate the house, with 7"-8" (R24-R30). The OCF can breathe those "microscopic diffusion particles easily" that we do not want to bother our minds worrying about. Let it breathe, lower your energy bills and will significantly improve your structure over the "traditional" case.
G. We are addressing now, a space where the thermal barrier (used to be blown in or laid in insulation on the attic deck exposed to nasty outside elements). Now the space is (insulation on the roof deck under the sheathing inside the climate controlled space) which redefines this discussion ... and extends it to the entire structure's envelope.
H. Assuming the 99.9% case where the level below an attic is HVAC controlled, properly sized and specified, with properly insulated ductwork in the attic space, no mechanical equipment in the attic space, then in this regularly seen case results in closely approximating the temperature and humidity of the space beneath it that essentially is open to the attic because all those attic floor penetrations are (not) sealed up and more importantly, the actual living space is going to be significantly more "humid" naturally where people are living.
I. The ah-ha moment and key to this is to understand that moist air is heavier and the 99% of it is dealt with by the HVAC system serving the space beneath the attic.
J. Measurements of T, RH and DPT in the attic space where WATER and AIR are sealed out, and OCF (no vapor retarder) is properly applied as the insulation (not the water barrier), the attic space will prove to be similar to the "living space" beneath the attic, provide far superior energy benefits over the "traditional" method, and allow that 1% or less diffusion-related vapor to easily move into the attic space to be naturally dealt with by the HVAC system serving the area beneath the attic.
I hope this summary helps those who need a decision path with some data but short of the graphs, the material science theses, or the environmental calculations.
Note: there are use cases for closed cell foam, other variations such as hybrids or combinations to address water barrier, insulation, and air quality management but for the 99%+ in the climate zone described, the above works well. The "IRC and other guidelines" are no replacement for quality construction, attention to detail in sealing the structure, and seasoned knowledgeable application of the OCF. If these are done on new construction with the correct foam product (OCF in this use case), then what is left is roof inspection say starting at 5 years for flashing or other roof penetrations, roof surface condition, with the priority to keep water where it belongs - outside.