Part of the problem isn't bad characters, it's their creators defending bad characters as good behavior. I'm reminded of how Marv Wolfman blamed Terra in the Teen Titans and defended Deathstroke's pedophilic rape of her, when in reality Deathstroke would have had all the power in such a relationship and everything that made Terra "evil" was a direct result of the failure and/or outright harm by all the adults that failed and manipulated her (DC is only just recently starting to call out Deathstroke on that, courtesy of John Bradley). So then in cop shows that portray police brutality, some shows will use that as a point of critique, some will use the show as a platform to defend or normalize brutality. But even in the case of the former, that could be misinterpreted as encouraging/glorifying brutality by the audience.
But that's not the end of it; oftentimes creators will state out bluntly that bad characters are bad, and so that's not a problem in and of itself (for some of them, the point *is* to show them as terrible jerkass humans that need to fix themselves) -- it's viewers interpreting those bad characters as heroic and citing them as role models without using critical analysis. Walter White, Don Draper, Joaquin Phoenix Joker, Travis Bickle, etc, are all characters that their own creators say are bad and yet are mimicked by shallow people.
Lately with all the anti-Asian violence permeating the news, there's also now a slew of articles and pieces by critics and media analysts about how stereotypes in Asian media portrayals have played a role in that violence, which includes not just racism, but xenophobia, sexism, and classism.
On the other side of the token, Drs. McCoy and Crusher in Star Trek are pretty famous for inspiring a number of people to go into medicine, and Mr. Rogers is constantly cited as a timeless model. That's not to say that every character must be depicted one way or another, but it really goes to show how media literacy and critical analysis of art and entertainment separates those that like Walter White as a character (which is good) and those that like Walter White as a role model (which is *not* good) -- two very different takes.