Of course it would be better for Biden's reelection prospects if he could remain popular with both younger, more left-leaning voters and older, more centrist ones, but I think the latter group is bigger, more likely to live in a state that isn't solidly Democratic, and actually willing to vote for Trump. (Trump is, in his not-very-coherent way, probably at least as pro-Israel as Biden.)
With that said, my guess is that Biden is actually doing what he believes is right, rather than simply maximizing his chance of being reelected.
Not just Biden. Most career politicians support Israel over any other priority since that is a major source of their fundraising, plus of course selection bias. If support for Israel gets you more funding for election, you are more likely to win over someone who doesn't support Israel.