What is the meaning of "Yivchar Elokim Chadashim Az Lachem She'arim"?
Rashi: Yisrael chose new gods, and then they needed [to fight] war in their gates.
Malbim: Hashem chose new ones to fight now that they had gates [of fortified cities] and needed to fight for them. Initially, 40,000 from Bnei Gad and Bnei Reuven went in front of them; now, He chose from Zevulun and Naftoli.
What is the meaning of "She'arim"?
Rashi: It is cities, like "b'Achad She'arecha" (Devarim 17:2). 1
Malbim: This war was for (to keep) the gates (cities), unlike Yehoshua's war, which was in the field.
What is the meaning of "Magen Im Yera'eh va'Romach b'Arba'im Elef b'Yisrael"?
Rashi: There was no shield or spear in Yisrael, and they needed to fight against 40,000 troop leaders that the enemy brought against them.
Radak #1: Yisrael were not able to show a shield or spear against in Yisrael, and even though there were more than 40,000 Yisraelim, they fled the enemy and were closed in their cities, and the enemy chased them until their gates.
Radak #2: When Yisrael did Hashem's will and did not go after other gods, in the days of Yehoshua, they did not need a shield or spear among the 40,000 Bnei Gad and Bnei Reuven who came to fight, even though they were Chalutzei Tzava.
Malbim: None of the 40,000 who came to fight [in Yehoshua's war] bore a shield or spear (now they were not chosen to fight).