They do think that way though, even the good ones.
It's why there is the phenomenon of women "becoming invisible" after they look a certain weight/age. It's why "pretty privilege" is a thing. And why so many men will misinterpret women's friendliness as romantic interest.
Because on the whole, most men don't give women the time of day unless they'd like to have sex with them. Even if they've no intention of actually doing it because they're in a committed relationship and are loyal. Unless a man thinks you're fuckable, you cease to exist in his universe and may as well be invisible.
There will be some exceptions. And there definitely ought to be exceptions to that mindset, where people are at work dealing with customers, but it doesn't always work out that way.
Treating women they like fairly nicely most of the time, but treating those they don't like abusively, is just an extreme example of the same thing.
Same with the middling behaviour, that's only morally wrong, of dating someone they don't particularly like and who they know is looking for a serious long term relationship. Lying to her that they want the same and are interested in her for that, just so they can have regular sex. Then dropping her the minute someone they like better comes along.
And sometimes trying to go back to the one they're not bothered about every time they're single.
Because at the end of the day they don't actually care how women feel about it all. They don't care about that particular woman they're doing it to, at all. So if she'll provide what they want, they're happy. And that's all that matters to most of them.
It's another way women should IMO learn from men. Not the bad behaviour and selfishness, or the way they don't feel any guilt about what they do, but the bit about why. It's because they have the mindset that if they weren't happy in the relationship, if they weren't getting anything/enough from it, they'd walk away and they expect women to do the same. But we often don't, having been socialised to put others first, put up with crap to keep relationships intact, and to ignore how we feel and just carry on.
Just look at how so many men behave with a common cold. Versus how women generally behave. And how women are just expected to put up with periods and menopause and get back to having sex ASAP after birthing a child, because heaven forbid a women feeling less than on top form should take any time for herself to recover until she feels better, especially if it impacts the life of some man somewhere. Nope, we're expected to suck it up and carry on, without even any acknowledgement or sympathy, a lot of the time.
So we subconsciously learn it in puberty and then "suck it up and carry on" ends up being some kind of guidance pattern for how we live our entire lives. I'm sure there are some men doing that too, but a lot aren't.
A woman talks about her ex and it's like: he was a fuck boi, he did coercive control, he was a narcissist, he was abusive, suspected he was alcoholic, acting weird like maybe he was doing drugs, "diagnosing" him themselves with some or other medical conditions and blaming his behaviour on that. Page after page after page of threads on here where women are trying to work out why their partner does xyz and whether they're being unreasonable in disliking it.
Men generally don't do all that. There'll be the odd one here and there, but mostly they just think "fuck this shit" and then step away from the crazy, going off to find someone else to live life with. "Why you break up with your ex?", "Oh, she was crazy!". They're not wasting time figuring out what type of crazy. They're just getting the hell out of there.