The social relationships among members of a society results in having influence on each other, if some persons commit sins it
Will affect others greatly, this view is considered in the Koran.
1. Every nation has its term, so whenever their deadline comes, they will not postpone it for an hour, nor will they advance it.(7:34)
2. You will see every nation crouching; each nation will be called [to appear] before its book: “Today you will be rewarded for whatever you have been doing.” (45:28)
3. We have made their action seem attractive to every nation.(6:108)
4. Every nation worried about their own messenger, how to catch him [off guard]. They argued with him in vain to refute the Truth. So I caught up with them and how [awful] was My punishment! (40:5)
5. It will be too bad for those who write the Book down in their own hand [writing] , then say : “ this is from God!” so they may sell it for a paltry price. It will be too bad for them because of what their hands have written. Too bad for whatever they earn!
(2:79)
6. Disgrace will be branded on them wherever they are overtaken unless they have a bad [leading] to God and a bad with other men. They have incurred anger from God while misery has been branded on them. That is because they have disbelieved in Gods signs and killed the prophets without any right to, that is because they disobey and act so aggressive.(3:112)
7. we decreed in the Book concerning the children of Israel : “ You will create havoc on earth twice , and display great haughtiness.” When the first of both warnings came we dispatched servants violence upon you (all). They rampaged through [you] homes, and it served as a warning which was acted upon then we offered you another chance against them, and reinforced you with wealth and children, and granted you more manpower. If you have acted kindly, you acted kindly towards yourselves , while if you committed any evil it was towards [yourselves] as well Thus the warning about the next one come along to trouble you persons, and so they would enter the Mosque just as they had entered it in the first place so they might utterly annihilate they overcame. Perhaps your Lord may show mercy to you. If you should turn back, we will go back (too) and turn the Hell into a confinement for disbelievers! (17:4-8)
In all the verses it is mentioned although each person will be his own be given his own punishment on the Last Day but the sins consequences will affect all the persons.