Metal Garage Ventilation

I had a problem with a house I remodeled for my daughter. It had metal roof above laundry room and sheet rock ceiling with insulation on top of it. When it started sweating and dripping down on ceiling I got a friend that owns an insulation business to look at my problem. He said the way to stop it was to insulate the bottom of metal and since it wasn't a job big enough for him he sent me to Lowe's and got spray foam in bottle similar to freon bottle. It solved the problem, Joe