So many men who have sex with men have internalized their sexual behavior as shameful and extracurricular. They can compartmentalize it in such a way as to make it “not count” in their own minds.
Many such man identify as straight, even though they seek out sexual encounters with other men fairly frequently.
I don’t know how your partner identified, but it’s possible that if he felt strongly attached to either the label gay or bisexual, he might have behaved differently and more responsibly.
Or maybe he was just a jerk from the get-go.