Unlike cellulose insulation, aerosol foam prevents excess moisture from a humid climate from penetrating the house. This dense material expands to fill openings, creating an almost impenetrable barrier. You'll avoid mold and mildew problems, and your house will stay dry all summer long. From the point of view of moisture management, it is safer to use closed-cell foam with air-permeable insulation.
Installing all the cells closed is equally less risky (if it's not particularly environmentally friendly). But it's probably easier and cheaper to install open-cell foam. I was thinking of making aerosol foam in the attic for both my house and the attached garage and the shared wall inside the attic.