Probably because if you are alone with a girl in a room by yourselves, she has to pay attention to you; You're the only thing that can get her attention.
But out at a club or whatever, there are other, better guys for her to occupy her time. Hell, even other girls to talk to might be more interesting than you.
The confidence you feel when you're alone with a girl is artificial. Its just a by-product of the fact that she HAS to talk to you. If there was another guy in the room that was more interesting than you, you wouldn't hold her attention, and that confidence would be gone.
You gotta lot to learn man, read the bible.