How can this be legal??
It's perfectly legal because it is not controlled by any legal governmental agency. It's a self sustaining community on private property.
Depending on the facts of such in the US, it would be illegal, non government notwithstanding
True but the laws in the country of South Africa are unlike any laws on this planet. As for excluding people of color in certain communities in America they have their ways of giving what they consider people culturally different from them a very hard time. That's a well known fact.
IMHO if I realized that I was not wanted in a community for whatever reason I would just move on.
What I mean is, say a Private mining town opens, with stores, banks, chamber of commerce, utility services etc., they are basically acting as a State Actor and can not discriminate, quell free speech, etc.
No, I meant no offense. Take care.