Unreal is free to the extent it contributes to bringing even more people into the ecosystem, eventually becoming paying customers, Epic doesn't make it available out of their kindness, rather also taking into account there are other competing alternatives.
A nonprofit means actual reports about how money is used, and it's not as if commercial projects are somehow better because they don't fold or get sold or canceled.
And even between commercial ways, charging royalties is one of the worst. It doesn't cost Epic extra if my game starts making more money. Just make the engine a one-time purchase (per version, so you get to keep sales going) and everyone will be much happier. Sell additional services which actually do cost you money to keep up (multiplayer hosting).
The engine itself is far from cutting edge and missing several features that are now quite common elsewhere, like texture streaming, bindless textures, etc. The speed of development isn't blazing fast either (see the implementation of the traits system). Devs are excellent at what they do but one could wonder how much faster and further it could go with more fundings.
> Sell additional services which actually do cost you money to keep up
After a game has been released a solo dev often has very little work to do, since they've already invested all of the development time ahead of release. So, by this logic they shouldn't really be allowed to charge anything for the game, except to cover potential work on updates.
Perhaps game projects don't need to operate like nonprofits, but then why do game engine projects?
"Order today! PO box 286 DOS... Except in Nebraska!"
xkcd has the answer.