boyfriend told me we are not compatible anymore

So basically he broke up with me after 2 years telling me we are not compatible anymore because we don't look like a healthy relationship. That is correct, we are not working any more, but honestly , he never tried to! He never treated me like his girlfriend, he was more like friend to me... I never felt him into this relationship, like he was full of fear of commitment , so he was like cold and distance sometimes to me.. That's why the problems came, because I felt most of the times like he was just having good time, but when the problems or the rough times came, he preferred to run away before dealing with them with me . I don't get it why he is blaming the relationship when he was the one never wanted to try to built one....  What do you think about this? He might be afraid of loving me? Or he wasn't in love that much with me?