What we have here is a case of collective accountability. A family can be judged; a village can be judged; a city can be judge; a province, state, country or region can be judged. In our example here, Sodom and Gomorrah were judged. Here the society was taken as a whole.