Not ot worry my good man...happens to just about anything with a penis...once in a while, or maybe more than once in a while. I wrote a friggin "Dissertation" about the same problem two weeks ago...and several guys answered the same way. The spirit is willing but the flesh...ie in this case, our most "proud flesh" just will not rise to the occassion.
At your age, you should not have any physical problems that would cause it. My younger brother (28) said he took a 100mg Viagra, for the next such session, after a disappointing meeting like you had, and he had an erection like a broom handle for an hour. Easy come, easy go.
A lot of it is in our head...Don't worry about it, and try to relax more the next time with her.