Sounds just like nerves. You normally get healthy erections, so you don't have a physical problem. You were probably just nervous about your first time. Many men will have slight ED problems their first time, and perhaps several times with each new woman. However, you eventually relax and feel comfortable with your partner and it goes away naturally.
You have to relax and try not to be so embarrassed about it. How do you do that? Well, the best way is to just talk about it with your partner. If it happens, tell her you just must be nervous, and that it's not her. She'll comfort you and eventually you'll be relaxed, perhaps even that day. But don't avoid trying again if it doesn't solve itself the first time.
Also, don't think that you won't get hard. That's self defeating. You get erections all the time, and didn't get one once. So don't go in thinking you'll lose your erection. And when you're there think of things that arouse you, not about getting or losing an erection. Pay attention to her body, or her touch, anything that arouses you. If you're aroused, you're likely to get hard. Thinking about getting hard usually doesn't work.
The condom can be tricky. If they're too tight, they'll push out some blood. But it seems many men just have problem getting it on in time. They concentrate on the task at hand, lose their erection because they're no longer aroused, then worry about losing their erection. While putting on the condom continue to think about what arouses you, not about the mechanics of putting on a condom.