More often than not, boys (and even some girls) do things to sabotage the relationship so they feel better about leaving.
Its so much easier for him to be a jerk, than to sit you down and tell you he thinks maybe its time to move on. Both hurt a lot, and its immature.
Sadly, I've seen it happen to my friends more than one time. You can't make someone want to be with you and for that reason alone you've gotta let the kid do what he wants to do. I wish he could have done it in a more mature way.