It's not a matter of causation, but of correlation, as explained by something called "Berkson's fallacy."

I'll just quote the Slate article, since the fallacy is complicated to explain:

Now, let's take as a working hypothesis that men are in fact equidistributed all over this square. In particular, there are nice handsome ones, nice ugly ones, mean handsome ones, and mean ugly ones, in roughly equal numbers.

But niceness and handsomeness have a common effect: They put these men in the group of people that you notice. Be honest—the mean uglies are the ones you never even consider. So inside the Great Square is a Smaller Triangle of Acceptable Men.

The Acceptable Men triangle contains the hot men who are nice AND the hot men who are mean, but only the ugly men who are nice. That's why it seems like there are more hot men who are mean compares ugly men who are nice. Does that make sense? Did I get that wrong? I'm sure you'll let me know in the comments.

Let's get to the important part, though. You know who'd be in my Acceptable Men triangle? Both Dr. Danny Castellano (hot and borderline mean/nice) and his portrayer Chris Messina (hot and nice). Why yes, I did just binge watch The Mindy Project and decided to use this post as an excuse to talk about them both.