Tanach · Rishonim on Tanach · Sforno · Torah

Sforno on Deuteronomy 17:5/ספורנו על דברים י״ז:ה׳

אאֶת הָאִישׁ הַהוּא אוֹ אֶת הָאִשָּׁה הַהִיא. וְלֹא נֶאֱמַר שֶׁהָיָה זֶה פְּתִיּוּת וּבַל יָדְעָה מָה, וְשֶׁאֵין צָרִיךְ לְדוֹנָהּ בַּשַּׁעַר שֶׁעָבְדָה בוֹ, לְהוֹרוֹת הֵיפֶךְ דֵּעוֹתֶיהָ.
1את האיש ההוא או את האשה ההיא, no mention is made in this connection of the idolatry being the result of seduction, the victim being foolish and knowing what he or she did, so that there is no need to convict him or her in the location where he or she committed the offence to teach the people who were aware of the sinner’s opinions that the truth is the opposite of what the sinner thought.
באֶל שְׁעָרֶיךָ. אֶל שַׁעַר שֶׁעָבַד בּוֹ, לְהַרְאוֹת שֶׁלֹּא יוֹשִׁיעֵהוּ הָאֱלִיל הַנֶּעֱבָד שָׁם אֲשֶׁר חָשַׁב הָעוֹבֵד לִהְיוֹת נוֹשָׁע בּוֹ.
2אל שעריך, to the public place where the idolatrous act was performed. By convicting and executing the idolater the public would have to admit that the deity worshipped by the convicted sinner was either unable or unwilling to save his life.