It’s not that collateral damage is irrelevant. It’s that the calculation as to whether collateral damage is “worth it” in the context of the specific goal/target is usually relative and calculated unemotionally. Some may say inhumanly.
Of course it's also worth pointing out that this question hinges on the perceived cost of collateral damage.
For countries like the US which at least ostensibly claim to care about human life indiscriminately and to fight for "liberty and peace" and all that, there is a considerable cost to collateral damage, although of course that also depends on who the victims are and the cost can be higher for a Democrat leader than a Republican.
Putin's Russia infamously responded to a hostage crisis in Moscow by killing not only all hostage takers but also more than three times as many hostages and injuring most of the survivors. That alone should make it easy to extrapolate what the cost of collateral damage in Ukraine might be in Russia's calculations. Israel similarly seems to use a much lower cost than the US although in Palestine this is also shaped by the perception that anyone who isn't a militant or supports the militant is eventually going to turn out that way anyway (e.g. the child who died would have grown up to become a threat anyway).