Spray foam insulation is a great product. Homes insulated with it can be some of the most efficient and comfortable homes built. I've been in plenty of these homes and can tell you that when spray foam is installed properly, they outperform 99% of fiberglass batt-insulated, stick-built homes. (I can also tell you that 73% of all statistics are made up on the spot, so please don't ask for documentation of that statistic.)
Spray foam comes in two flavors, open cell and closed cell, and provides both parts of the building envelope - the insulation and the air barrier. The building envelope should completely surround the conditioned space, and the insulation needs to be in contact with the air barrier. Since spray foam is both insulation and air barrier, proper alignment of insulation and air barrier is guaranteed.
What's not guaranteed, however, is that all spray foam homes will be efficient and comfortable. I've seen a number of houses with problems even though they're insulated with spray foam. In order of prevalence, here are the problems I've seen, with explanations following the list:
Spray foam isn't thick enough.
Spray foam installers missed some of the air leakage sites.
Spray foam installers didn't understand the building envelope and sprayed either too little or too much.
Spray foam contracts and pulls away from framing.