Spray foam can be used to insulate a metal roof but spray foam is difficult to apply and must be done by a professional. Spray foam insulation for metal roof buildings is not an option for the DIYer, so if you're looking to do this yourself you want to stick to foam batting or rigid foam boards. \