Being nice and caring is one thing. Being a martyr is another, and in order to avoid being a martyr, one needs to be able to distinguish emotionally health people from emotionally unhealthy people, which seems to be something you can stand some help with. I find when someone truly believes they deserve some kind and loving, they don't stay in relationships with people who are unloving, yet you have two histories that indicate you have gone down that path. You might be consciously saying you want someone kind, but your subconscious is saying the opposite: that you don't truly believe that.
We ARE our history, because we made that history ourselves. Some things, of course, just "happened" to us, but that takes place in childhood, before you are able to make your own decisions. Once you reach adulthood, that history is of your own making. I don't like the way Not4u phrased it, but technically, his statement, although a bit unkind, is accurate. Don't blame this on others' ugliness or you'll stay trapped in picking emotionally abusive people to have relationships with. Look at yourself.
I have a friend, whom I love dearly - and dated very briefly - who continues to blame his partners for the failure of the relationship, when it is clear that he has rejected healthier people (me, for one, but that was for the best. I realized I'd be better off as a friend. I wouldn't have made him happy - and he certainly wouldn't have made me happy in the long run, either). He is clearly uncomfortable any time I bring up the subject of genuine intimacy when he mentions guys he's talking to online: I see his leg start tapping on the floor furiously. I know what that response indicates: discomfort with the subject matter. But he has yet to face that fact and he is 63. But I also know his family history: his parents were very cold and emotionally undemonstrative, and - and this is not to put him down - that kind of environment makes him a prime candidate for picking the wrong people, because "Love" was never modeled for him, so he makes up his own definition, which would be fine if he kept his eyes open and not closing them in denial. I can just be there for him.
His last lover, whom he moved in after a month of knowing him, gave him Hep C, and he's already HIV positive. I had to bite my tongue off not tell him he was clearly off his rocker, other than to ask him if he wasn't moving way too fast. And now he's got lesions in his rectum. I want to hug him and choke him at the same time for dong this to himself. This was clearly preventable, but he's in serious denial about his emotional (in)capability in picking out someone healthy, but right now he needs sympathy, not "tough love." He's having to face his mortality because of this last caper with the wrong guy, whom I am 100% positive he didn't even ask about any diseases the guy might have. But when they separated, the guy told him, and it was at this point he became indignant with the guy, when I know from looking at his computer, he advertises for bareback sex. Stupid? VERY. But he's a been a sweetheart of a friend, and this is not the time to give him a hard time.
So, don't do this to yourself. Based on your posts, I think therapy could be very helpful for you, if only to have a professional who reflects your choices back at you and makes you look at why you pick those who aren't good for you. There are AlWAYS red flags in anyone who's abusive (excessive sarcasm, withholding emotional support, constant putdowns, reaffirming "you can't do anything right," to point out just a few red flags), but you seem unable to see them, or else you rationalize them to yourself and then it blows up in your face, and very badly at that. You do deserve better, but are you capable of recognizing what "better" looks like?