1 Answer
1

The Ramban on the story quotes the Rambam as saying that the inhabitants of Shechem were required to judge (the person) Shechem and did not. As such, they did not fulfill the obligation of the descendants of Noach to judge justly. A descendant of Noach that fails to fulfill one if his 7 obligations (namely 1. belief in the creator, 2. prohibition of incest, 3. prohibition of theft, 4. prohibition of murder 5. prohibition of eating livre animals, 6. prohibition of idolatry, 7. to judge justly) he is to be executed. The inhabitants of Shechem did't do #7 so were put to death. The Ramban debates this explanation for the city of Shechem, but that is at least what the Rambam says.