How Does Something Immoral, when Done Privately, Become Moral when It is Done Collectively?

How Does Something Immoral, when Done Privately, Become Moral when It is Done Collectively?

How does something immoral, when done privately, become moral when it is done collectively? Furthermore, does legality establish morality? Slavery was legal; apartheid is legal; Stalinist, Nazi, and Maoist purges were legal. Clearly, the fact of legality does not justify these crimes. Legality, alone, cannot be the talisman of moral people.
– Walter E. Williams