Recognizing the Flags Earlier

I had been dating my boyfriend for nearly 4 years. Around the anniversary of our third year, he confessed he had cheated one me twice, and had lied about many other things he had told me in the past. I was so heartbroken but we had been living together and had spend 3 years together, it was hard to just shut his switch off like that. I found myself trying to work things out and give him the chance to reinstate trust, but he never seemed to be trying as hard as I was expecting he would want to if he really "loved me" and really wanted to make up for his horrible mistakes. We decided to call it off, but still talked about working towards getting back together at some point. Then, approaching our 4th year, he found a girl he felt he liked more than me, and told me he's choosing her over me. I told him I can't be his friend and watch him date someone else, and he said he chooses this stranger over me being in his life at all.
A good person doesn't do bad things to the people they love. If they are capable of doing those things, there is something wrong about them. Call is selfishness, immaturity, whatever. Now I am heartbroken all over again, and having to deal with this pain like it just happened again. Looking back, I recognized our imperfections before his admittance of cheating, and wish I had let him go earlier. I don't regret the time we had together because it happened for a reason, but I do regret sticking around after he told me what happened the first time. His actions made him absolutely unworthy of devotion then, and especially now.