He may have a medical complaint, might have been nervous or any number of reasons.
Erection issues can be numerous in reason.
One question I have to ask is did he become erect at any point?
If he was all up for it then went down on you then sorry to seem rude but a smell may have put him off, no offense, it happens to ALL girls and a lot don't know it.
I suspect however that he wasn't getting erect and went down on you to avoid the elephant in the room and probably got himself into a catch 22 by worrying about not having an erection and thus making himself too distraught to get one so its a vicious circle.
He may indeed have a problem with impotence, might have had a lot on his mind or he may have just been a little ill that day, its hard (excuse the pun) to say.
He may even be gay, I hate to say it but there is that possibility amongst many many others.
All in all I suspect he was nervous and may be shy or scared that he can't meet your sexual expectations (yep, we guys hate that feeling girls).
I suggest getting him comforatable and confident in conversation one night and approach him for sex again, show him you appreciate cuddling and kissing and leave sex alone.
He may find himself a little more relaxed, it was his first night staying at your place and might have felt a little uncomfortable,
If the next time you attempt to have sex he becomes distressed then ask him what the matter is in a calm way and reassure him that no matter the problem you will respect his privacy on the matter and will help him however you can.
I don't really want to put the worry in your mind but if he has been raped, humiliated by an ex (ie. told him he was bad in bed) or something emotionally distressing to him then it may take a long time before he feels comfortable and confident but with time and you showing him love with kisses and cuddles in a loving manner and that you are there for him things will change over time.
Again, might have just been an off day.
I wish you both the best and remember, remind him love is more important than lust.