No. Spray foam insulation applied to metal panels before they are installed can create gaps in laps, make it more difficult to fasten properly, and cause overspray on the top side of the panels, which can affect the long-term performance of the paint.
The Spray Polyurethane Foam Alliance, an association representing leaders in the SPF industry, has created a guideline for insulating metal buildings with spray polyurethane foam. It can be reviewed by clicking here. More information is available on their website at www.sprayfoam.org.