The Prophet, peace be upon him, said, “The example of those who respect the limits of Allah and those who violate them is that of people who board a ship after casting lots, some of them residing in its upper deck and others in its lower desk. When those in the lower deck want water, they pass by the upper deck and say: If we tear a hole in the bottom of the ship, we will not harm those above us. If those in the upper deck let them do what they want, then they will all be destroyed together. If they restrain them, then they will all be saved together.” (Bukhari).
This hadith shows that all aspects of a country, community, family, and society are intertwined. When one person in a group does wrong, it harms everyone. They may not feel the immediate impact that wrongdoing has on them, but it sooner or later it will take its toll and the entire group will sink. We do not stop wrong for the other person, but for our own sake as well. If a community suffers from oppression, drug abuse, racism, or lack of modesty, all of that will have an impact on the entire society. Corruption has appeared throughout the land and sea by [reason of] what the hands of people have earned Likewise, when there is good done, all of society benefits (Q. 30:41). The opposite is also true, when we do good on earth corruption and mischief disappears.