Being afraid of probable threats can keep you from getting into a potentially dangerous situation. If I'm afraid of heights, but by this philosophy am really afraid of the fall, then my fear keeps me away from the edge of the cliff so I have less of a chance of falling, so it is by no means irrational. Claustrophobia helps me stay away from narrow spaces I might get stuck in.
However, some fears are irrational. Fear of flying is about lack of control, for example.
People are funny creatures