Can I tell my bff's ex the real reason she broke up with him
That sounds like a predicament. What is the real reason she broke up with him?
To be fair it's both parties fault.
You shouldn't tell your friends their secrets. It would hurt them and they won't want to be your friend anymore.
I've been good to her so she shouldn't get mad at me.
Sure, you've been good to her, but it's important to consider the aftermath if you were to expose the secret. It might be in your best interest to not get involved because you might just end up hurting her more. It's probably not worth it, but at the end of the day, it's up to you.