In the Quran, there are instances where full nations were destryoed by Allah due to sins of some or even many (homosexuality etc)
Do you think such collective punishment is right or wrong?
A nation being destroyed does not imply that death is a form of punishment. Death is the end of your stay in this world per Islam. The suffering before the moment of death may be a form of punishment intended to erase some of our sins or it may also be a test of our faith in Allah SWT. This is something we cannot accurately fathom. A persons punishment or reward is alotted after judgement not death.