So yes, funding Godot is A Nice Thing To Do but it also conveniently puts a bit of pressure on Unity, their biggest competitor, without impacting their own business.
Also, if you believe Matthew Ball's take[0] then Epic is all-in on fostering as many gamedev-ish creators as it can so that it can loop them all into making content for its metaverse later. As you alluded to, in the long term funding a FOSS game engine which is focused on ease of use helps that too.
If Epic Games really cared about Godot, they would align more with their values in-house. Their M&A drives the organization like a propeller.
However, their stakeholders decided circa 2019/2020 that they want to influence the development of Godot and spent their money that way. Corporate donations aren't at a whim like us individuals who spend $3/mo on Wikipedia or a food pantry, it's considered by the executive team, calculated and green-lit by their accounting team.