How many things have you done in your life that you are not proud of? Can you imagine that perhaps there are things you did that hurt others and you are not even aware of it? I'll even quote your original post. "i wanted to have sex with her because i am horny but more for the fact that my ex would find out. And find out she did. it crushed her and i hated seeing her like that. Having sex with her roommate made me feel terrible and made me think about my ex more." Does any of this make you a bad person? I seriously doubt it...
I'll give you an analogy... If you adopt a puppy, do you get angry at it when it poops on your carpet. Not likely. You patiently teach it that it has to go outside. Now if you never bothered to teach that lesson, is it the dogs fault that it still poops inside the house after it has grown up? This is no different. You never taught this girl that she can't treat you like that, thus you are the one responsible. It's not her fault if she doesn't know better, nobody ever taught her.
As far as the letter goes... I'd hold off until you truly understand this lesson. And if you do decide to write it after that, I'd recommend that you thank her for the experience.