Is this codependency that I just want to hug him and tell him it will be okay?
I don't think this is codependency, I just think it is being a decent, caring human being.

Codependency, to me, would be if you still wanted to date him, thought you could "fix him", and felt content knowing that your SO "needed" you.
I have nothing but sympathy for my ex, too. I saw her without "the mask" enough to see just how much deep, emotional pain she has to live with on a daily basis. In fact, I recognized it from my own severe emotional difficulties of many years ago. The self-loathing. Crying yourself to sleep each night. Yup. I've been there and it is hell. In fact, seeing that in her definitely triggered my own codependency, and I stayed in the relationship
way too long, thinking I could somehow impart some wisdom from my own past experiences and ultimately "help" her. What did I get for my effort and compassion? I got tagged with an STD on the way out! Kind of serves me right for the arrogance and codependency, though... .
I know it's hard, but you have to realize there is nothing you can do to help him out. You can feel sorry for him if you like, but your pwBPD's life is
his responsibility -- and his alone. He may be suffering, but that should not stop you from moving ahead and enjoying your life.