nope you are not impotent. you get spontaneous erections - this is good! you also get erections when you masturbate, so there is nothing physically wrong with you. all this is caused by your own anxiety. trust me, it is really really common and much more guys go through it than you probably think! having sex for the first time is often a strange and nerve racking thing.
ever had to do a talk or presentation in school in front of the class? it always runs so smoothly when you practice it on your own but as soon as the time comes to do it for real you're shaking and you forget your words and your voice quivers... lol. it's basically the same thing.
what you have is not an medical problem, it is just performance anxiety. all you have to do is learn to relax and take things slowly. if the girls you have been with have been 'one night stands' then it probably doesnt help matters. you need to be comfortable with the girl you're with and trust her. take the focus off sex for a while and instead take the time to chat and mess about, be a bit playful and lighthearted, and don't rush into it. maybe you can just lie about naked with her for a little while, just touching and exploring. but the best advice really is TAKE IT SLOWLY and RELAX AND STOP WORRYING!