Firstly he doesn't know he did wrong - he will have responded in that way because of the whole situation...
I can understand why he bit. He is in (for him) a fairly high stress environment, so he is on edge... he was asleep and suddenly disturbed... in a state of high alert, but sleepiness, he reacted defensively.
However, it is a situation I don't think you can ignore, and I really think you need to a) get him checked at the vets to make sure there isn't a medical issue which has made him more uneasy and b) get a (positive, reward based) behaviourist (steer clear of any who start talking about dominance and pack theory) to visit and observe him so that you can do everything possible to reduce the potential for stress (and so stress reactions, like biting).
I do think that, as you have a toddler, it is important that Alfie has an absolute place of refuge where he is not going to be disturbed at all - while your bed may be refuge from Ryan, it's still not a space of his own, and he has shown that he is still feeling on edge when he is there. Our dog has her bed and her crate, both of which are utterly out of bounds to all humans... her crate is her ultimate place of retreat, and if she has taken up refuge in there there is no question of encouraging her out or anything, she is just left to it until she wants to come out - the only reason we put hands in the crate is to give her treats when she is left. Alfie doesn't have anywhere that "safe" and is showing you that he doesn't have anywhere her can fully relax. Would it be possible to have a crate or bed for him in your room? I don't think dogs sleeping with owners is a problem in general, but I really think Alfie needs his own space where he can feel completely unthreatened....