I think that the Lewis to Ferrari deal was for the car company/brand more than the race team.
If Lewis retires as a Ferrari driver, especially if he can win a championship with Ferrari (big 'if'), he can be the 'face' of Ferrari for the next 50 years. He will be a force who can pull in sponsors and young talented drivers unlike anyone else Ferrari could possibly hire. Lewis will have an active post racing career, both in terms of business ventures and charitable causes. Having Ferrari associated with those, even footing the bill for those, will be win win for both Lewis's Brand and Ferrari's Brand.
Sure, Carlos is doing a fantastic job, and making the decision look foolish which is putting the race team in a bind. However, if decision time comes for Carlos, and he's clearly outperforming LeClerc, then Ferrari has shown they're happy to pay someone not to race to make room for champion. While I expect that LeClerc will pull even with Sainz as the season progresses, if he doesn't, his contract won't keep him in that F1 seat.
In a few years I feel like this will be an interesting footnote in the sport, and the Lewis/Ferrari dynamic that defines the sport amongst casual fans.