Insulating the attic rafters with spray foam creates a conditioned space where your attic is the same temperature as the rest of your home. This keeps the external weather and moisture outside of the attic space so you don't have to worry about any moisture problems or air infiltration.