Notice all these cases are from the South.
I don’t think this is a „black people can‘t have white friends“ problem. It’s more of a „southern whites never received retribution during reconstruction“ kinda problem that has led to consequences to this day.