He’s arrogant, cruel, self-righteous, petty, venal, and in so many ways a jerk. Yet he’s funny, witty, and charming, so he’s the star of the show.
Maybe you didn’t think of Benjamin Franklin Pierce, AKA Hawkeye from M*A*S*H, as an awful man, but he is. He belittles Frank Burns rather than help improve him, he objectifies women, makes sport of everyone, can dish it out but can’t take it, and while he’s a great meatball surgeon, if you knew him in real life, you’d consider him vain, shallow, and mean.
That’s the power of story. As a fictional character who you don’t have to live with, Hawkeye is fun. As a co-worker or friend, he’d be tiresome.

In a story, though, Hawkeye promotes conflict. He riles people up, then awes them with his skill as a wit and a doctor.
He is deeply flawed, which makes him an engaging character. My main characters are often too nice, too good, because they are the observers of the action.
That’s a weakness in my writing and one I need to correct. A flawed character can get worse AND can get better; he can change. He’s unpredictable and stirs controversy. He gets himself into and out of trouble. He commits the action, he is not acted upon.
Hawkeye is a great character, but a lousy person. Make sure your characters are flawed yet have a way of covering themselves.
Another example of this is Psych, a favorite of my children. Sean’s a jerk. Flat out, lousy friend, jerk. Gus MUST have been abused as a child to put up with him. Jewels is out of her mind for caring about him.
But he’s funny. Audacious. Gets away with stuff we can’t.
He’s good story.
Gregory House is another jerk, but he pushes the jerk way hard with the only redeeming quality is that he knows medicine. He is THE most unlikable human on the planet played so fetchingly by Hugh Lorrie. Roguish, biting charm…
In Star Wars, everyone’s favorite human is Han Solo. A roguish, charming bad boy with a tarnished heart of gold.
There must be something good about being bad.
In a story (don’t take that as an excuse to be a charming jerk in real life).