Swarmkeeper
Hero
I do agree that incentives can certainly drive behavior.This.
Players kill because that's usually the easiest, most straightforward way to achieve their goals. Put a XP reward on top of that and the decision to kill becomes a no brainer.
If you really have a problem with all the killing, you just have to offer alternative ways for the party to handle obstacles.
That said, I would also like to point that there are systems better suited to that play style than D&D.
Although, in our current campaign where players earn session-based XP, I haven't seen them pull back from fighting perceived baddies to the death. Granted, it's a Curse of Strahd/Ravenloft West Marches game so, yeah, the undead are not letting up. But we (multiple DMs) have introduced new factions of potential enemies that are not undead - and the players more often than not opt to wipe them out anyway. Even the poor lone ratfolk scout who wasn't even supposed to be working that day!