To say that Catwoman is popular is largely under-rated. As for the villains of Batman, she is, at worst, one second behind the Joker, and the third – I do not know, the Penguin? Scourge? Two-faced, who absolutely hates being third? – is not even close. But when a character is so popular for a long time, with a convincing hook and a methodology that is a little easier to forgive than, say, being a genocidal murderer clown, they tend not to stay bad forever.
Often, this happens to female characters, and – more often than not – it happens because of that romantic tension that they have with the hero. It's pretty common to be a full-fledged snapshot, to the point where there's a lot to be said about the lack of nasty women with agency in superhero stories, which are not only bad until they are seduced
Catwoman, however, is better off than most, partly because she's a longtime character who's been refined for decades, and partly because its "redemption" has never really betrayed its existence. In the '90s, when she gets her own solo title (extremely long), her protagonist role is always defined by the kind of outlaw personal interest that has always been at the heart of her character. As the rest of Batman's villains worsened (morally speaking), she remained relatively constant.
In other words, she was criminal but she mostly stole things instead of, you know, cut people's faces. On the large scale of morality in Batman's comics, it basically placed him below Commissioner Gordon.
Either way, reclassifying her as a protagonist, if not a complete hero, made their relationship much easier to justify, pushing them back to a fate that even the old chargers of the past had wanted since 1940 If Batman were ever going to get married, she would definitely be the bride. That's probably why they got engaged in 2017, and – spoiler warning for a fairly new comic book if you have not already read it – all I just wrote is probably why this wedding did not take place as planned.