War is about achieving political ends, which killing may or may not be instrumental towards. It's very unclear to me whether Iran's killing of Americans and Israelis, either directly via missiles or via their proxies, had realized any benefits for the nation of Iran, let alone for the average Iranian.
American and Israeli soldiers are invading Iran currently. So just like standard procedure for any war, killing as many enemy combatants as possible is the point and beneficial for Iran as it aids toward repelling the invasion. America at least can be pressured to withdraw as the general populace is ambivalent about the war.