I have a theory on why a number of people have claustrophobia. It's in the top 5 of things we're afraid of.
I think it is because we remember our time in the womb when our environment was very enclosed and very tight. You might wonder why a memory of our time in the womb would scare us since it was probably a happy time. What we also remember though is that we were completely submerged in a fluid.
As an adult, if you've ever been swimming, you know being submerged in liquid for a small time means death. We learn to fear the danger in our environment. This lesson coupled with what we subconciously remember from the womb, and retroactively, we develop claustrophobia.