dear sarah, (would you please , forgive my poor english...)
could you tell how old are you ? i'm so sorry for you , through what you say , i think i understand , that this boy gave up because he feared to be abandonned the first, ... so he probably suffers a missing of selfconfidence, may be he has been hurted yet very strong by someone who let him... are you still in contact with him?
can you let him a kind of message to ask him a deep explanation... maybe he saw through your behaviour some kind of things that made him fear...and that you couldn't suspect, maybe you didn't say or do anything that objectivaly is bad,... it's probably not your fault...
many guys are frigtened about the simple idea of any kind of engagement, i mean investing ..., and give up seams to be the only way out to not build something...