אור החיים בראשית ל"ד:כ"ה
ויהרגו כל זכר ואת חמור וגו' – קשה למה יהרגו מי שלא חטא. ועוד למה לא הקדימו בבעל עבירה תחילה.
אכן הנה בני יעקב לא היה בדעתם להרוג אלא בעל עבירה אלא שכל בני העיר רצו לעמוד בפרץ כנגדם לבל יהרגו מלכם אשר על כן הרגום מדין רודף, והוא אומרו ויהרגו כל זכר ובזה השיגו להרוג את חמור ואת שכם וזולת זה לא היו יכולין לנקום נקם מהמחוייב להם מיתה.
ויהרגו כל זכר - They killed every male. Why did they kill people who had not actively committed a sin? Why did they not first kill the truly guilty, i.e. Shechem?
Actually, the sons of Jacob did not intend to kill anyone except the guilty party; however, all the inhabitants formed a human barrier to protect their king and prince. As a result the sons of Jacob were forced to kill the towns people under the heading of killing a רודף, a pursuer, someone who endangers the life of the avenger. When the Torah states that they killed all the males this means that they succeeded in killing Chamor and his son only after killing the other males in the town. Had they not done so they could not have executed someone who was guilty of death.