I don't think your compassion is misplaced, at all. In fact, I think it shows that you've developed greatly as a person - even though you are hurt badly by someone, you are able to understand that they are acting out of their own pain and struggles, and that it isn't really about you as much as it is about them.
But you have to have equal compassion for yourself. If you stayed, you wouldn't be a bad person by any means - you'd be a kind woman who had nothing but the best intentions. But, you would still be that same woman, with the same good intentions and character, if you did leave. The question is, what is best for you? What do you think you deserve? Is it what he has done? He is no less deserving of love for his own self-worth issues, but that isn't the problem, as I see it. The problem is how he chose to respond to those issues. He had a million paths he could take to deal with these issues, and he chose ones that were destructive to himself, to you, and to the integrity of your relationship. It's not about testosterone, it's not about transition, otherwise all trans men would be doing the same stuff. Many of us have low self-worth and have been abused. Many cis women have too! And some do choose the activities that your boyfriend has. Some don't. I don't think he is a bad person, and I doubt he meant to hurt you...but he has made bad choices. And choices come with consequences. The consequence may be that the woman he loves feels she deserves better, and in my opinion, you do.
To give you an idea of where I'm coming from, my girlfriend of 3 years left me a couple of years ago because of my self-loathing. I didn't go to the extent of cheating, but that's not important. What's important is that my actions, and sometimes lack of actions, left her hurt and feeling like I didn't have any regard for her. When she left, I cried, I was angry, I would call her up and accuse her of never having loved me...but she stuck by her guns because she knew she needed something I couldn't give her at the time. We'd go long periods with no contact. In time, I came to realize that she really did love me, even when she left me - and that leaving me must have hurt her so much. She often felt guilty because she felt like she was abandoning me when I needed love the most. But she knew she had to do it for her, because in her words, she was becoming the type of woman she always swore she'd never be - in the relationship she always told herself she'd never have. It took me a long, long time to really understand, but it wasn't all about me. I have come to respect her strength and conviction. I have also come to respect myself. Because I realized that my self-destruction didn't just hurt me, it hurt the people I love, and I needed to decide what was more important to me - my demons, or the people I care for? I went to a counsellor, I started to be honest with her (my counsellor) and myself, and I began to grow into a happier and stronger man too. Did it hurt us both? Yes. But not as much as it would have long-term if we stayed together. And rather than continue to break ourselves down in something that stopped working, we have both grown as people. We're still not together, and the chances of that happening are next to none. And sometimes it still hurts to know that my issues led to this, but I also know, that was the sacrifice I made for choosing to ignore my problems. In essence, I really did prioritize entertaining my demons over those that I care for. I have to live with that, but it pushes me every day to try and be a better man, to others and to myself.
I'm not saying you have to leave him, lol, it's certainly not my place! But I am saying, I really strongly advocate that you stick by your guns. You can hold compassion for him without losing your compassion for yourself. He may have been dealt a tough hand, but that doesn't make the world stop turning, it doesn't negate your needs, and when we are dealt tough hands, it is ultimately up to us to take it on. You deserve love too! And you deserve a man who can give you the things you need, and who cherishes you. If you stay, you need to change the conditions of your relationship. He would need to earn your trust again. He'd have to be willing to be honest not just about what he's doing, but about himself, his feelings, and he'd have to be willing to not just ignore his issues for your sake, but to work on addressing them, probably with a professional.