Before conquering the land, Moses summarizes the wandering years:

And the days in which we came from Kadesh-barnea, until we were come over the brook Zered, were thirty and eight years; until all the generation, even the men of war, were consumed from the midst of the camp. (Deuteronomy 2:14)

וְהַיָּמִים אֲשֶׁר הָלַכְנוּ מִקָּדֵשׁ בַּרְנֵעַ עַד אֲשֶׁר עָבַרְנוּ אֶת נַחַל זֶרֶד – שְׁלֹשִׁים וּשְׁמֹנֶה שָׁנָה, עַד תֹּם כָּל הַדּוֹר, אַנְשֵׁי הַמִּלְחָמָה, מִקֶּרֶב הַמַּחֲנֶה. (דברים ב', יד)

He then repeats the expression:

So it came to pass, when all the men of war were consumed and dead from among the people, (Deuteronomy 2:16)

וַיְהִי כַאֲשֶׁר תַּמּוּ כָּל אַנְשֵׁי הַמִּלְחָמָה לָמוּת מִקֶּרֶב הָעָם. (דברים ב', טז)

Many commentators, including Rashi and Ibn Ezra, understand “the men of war” as military-age men twenty and upward, decreed to die in the wilderness. If this was intended, however, why did Moses not use the usual expression “those able to go forth to war”?

“The men of war” generally refers to actual participants in a war, as in Midian’s war:

and they said unto Moses: ‘Thy servants have taken the sum of the men of war that are under our charge, and there lacketh not one man of us. (Numbers 31:49)

וַיֹּאמְרוּ אֶל מֹשֶׁה: עֲבָדֶיךָ נָשְׂאוּ אֶת רֹאשׁ אַנְשֵׁי הַמִּלְחָמָה אֲשֶׁר בְּיָדֵנוּ וְלֹא נִפְקַד מִמֶּנּוּ אִישׁ. (במדבר ל"א, מט)

Which war, then, is meant?

After the spies’ sin, the LORD decreed that the wilderness generation would not enter. Recognizing its sin, the people sought to correct it, girded themselves with weapons, and wanted to go up and fight, but He prohibited it:

we will go up and fight … and ye girded on every man his weapons of war … And the LORD said unto me: Say unto them: Go not up, neither fight. (Deuteronomy 1:41–42)

אֲנַחְנוּ נַעֲלֶה וְנִלְחַמְנוּ ... וַתַּחְגְּרוּ אִישׁ אֶת כְּלֵי מִלְחַמְתּוֹ ... וַיֹּאמֶר ה' אֵלַי: אֱמֹר לָהֶם לֹא תַעֲלוּ וְלֹא תִלָּחֲמוּ. (דברים א', מא-מב)

Despite the warning they ascended the mountain and were defeated by the Amorites.

A marginal note in a manuscript of Rashbam’s commentary proposes this is precisely the war Moses alludes to:

And I, the younger one, say: the men of war were those of whom it says, “But they presumed to go up to the top of the mountain” (Numbers 14:44), as he said, “and ye girded on every man his weapons of war” (Deuteronomy 1:41). Moses told them, “Go not up, neither fight” (Deuteronomy 1:42). Likewise in Joshua: “For the children of Israel walked forty years in the wilderness, till all the nation, even the men of war that came forth out of Egypt, were consumed, because they hearkened not unto the voice of the LORD; unto whom the LORD swore that He would not let them see the land,” etc. (Joshua 5:6). Hence he calls them “the men of the war,” not simply men of war, but the men of the war known to us, who transgressed the Holy One’s command.

ואני הצעיר אומר, אנשי המלחמה היו אותם שנאמר בהם: "וַיַּעְפִּלוּ לַעֲלוֹת אֶל רֹאשׁ הָהָר" (במדבר י"ד, מד), כמו שאמר: "וַתַּחְגְּרוּ אִישׁ אֶת כְּלֵי מִלְחַמְתּוֹ" (דברים א', מא), ומשה אמר להם: "לֹא תַעֲלוּ וְלֹא תִלָּחֲמוּ" (דברים א', מב), וכן ביהושע הוא אומר: "כִּי אַרְבָּעִים שָׁנָה הָלְכוּ בְנֵי יִשְׂרָאֵל בַּמִּדְבָּר עַד תֹּם כָּל הַגּוֹי אַנְשֵׁי הַמִּלְחָמָה הַיֹּצְאִים מִמִּצְרַיִם אֲשֶׁר לֹא שָׁמְעוּ בְּקוֹל ה' אֲשֶׁר נִשְׁבַּע ה' לָהֶם לְבִלְתִּי הַרְאוֹתָם אֶת הָאָרֶץ" וגומר (יהושע ה', ו). ולפיכך קורא אותם: 'אנשי המלחמה' ואינו אומר אנשי מלחמה סתם, כי אם אנשי המלחמה, הידועים לנו – שעברו על פי הקב"ה.

If correct, the wilderness generation’s significant sin was not the spies’ fear-driven sin but the warriors’ deliberate rebellion in ascending to fight. Although not every member actually went up, these warriors apparently acted for and on behalf of the whole people, so Moses names the generation after them.

Calling the spies’ generation, utterly defeated in battle, “the men of war” is ironic. Promised the LORD’s help in conquest, they feared and refused to fight; warned not to go up because He was absent, they insisted and were defeated.

Perhaps the title also hints that this war sealed their fate. Had they accepted the sentence and refrained from ascending, the LORD might have accepted their repentance as elsewhere. After another rebellion, however, He no longer answered their weeping:

And ye returned and wept before the LORD; but the LORD hearkened not to your voice, nor gave ear unto you. (Deuteronomy 1:45)

וַתָּשֻׁבוּ וַתִּבְכּוּ לִפְנֵי ה' - וְלֹא שָׁמַע ה' בְּקֹלְכֶם וְלֹא הֶאֱזִין אֲלֵיכֶם. (דברים א', מה)