This is assuming that the attack action and heal spell action are “normal” in every scenario, which is not true.As long as dealing damage creates a bigger swing in the damage race than healing does, healing will always be a less efficient use of resources and action economy than dealing damage, unless it brings someone back into the fight who had been taken out of it. There are therefore only two ways to prevent whack-a-mole healing: buff healing so much that it outpaces damage, or remove the rule that an unconscious character regains consciousness if they gain HP.
For example if one kd these is true
1) I have disadvantage on my attacks.
2) I can’t reach the monster (cover, darkness, etc).
3) I got damage the monster (immunities).
4) the wounded player is particularly good at damaging the monster (buffed up, vulnerability)
In these scenarios the value of healing increases