In a basement, moisture comes before warmth. Every job starts with me walking the walls with a flashlight, looking for wet spots, white crust on the concrete and cracks that let water in. If water is coming through the wall, we deal with that first, because insulation over a wet wall just holds the damp against it. Then we clear the walls and seal the gaps at the rim joist, the band of framing that sits on top of the foundation, and around pipes and wires, so the insulation isn't fighting a draft. Last, we put up a material that won't soak up the damp sitting against the concrete, and we finish it the way your plans for the room call for.
When foam is the right call, the choice is usually between closed-cell foam insulation, the dense, rigid kind, and open-cell foam insulation, the lighter, softer kind. I'll tell you which one your walls need, and why, before anything gets sprayed. The questions below cover how that choice gets made.
Spray foam on bare concrete
This suits a basement you plan to finish, or one with uneven block walls and lots of pipes and corners, because the foam fills every dip and seals air as it goes on. Foam has to be covered with ignition-barrier paint, a fire-slowing coating, or with drywall, so that layer is part of the job.
Foam board behind a framed wall
This suits straight, dry walls when you're framing and hanging drywall anyway, because rigid board doesn't soak up water and the studs go right in front of it. We seal the seams so air can't slip behind the board, and this usually costs less than spraying.