I kinda think in that instance there wouldn't be enough of an audience to really attract much in the way of fangames.
But setting that aside, in such a circumstance if fangames attracted enough of a crowd away from that company's games to significantly impact their earnings, then that honestly just sounds like the inevitable happening. They would have likely faltered rapidly anyway if a significant portion of the audience stopped buying their games in order to play a game released by one person. Whether that be to a fan-game, or to a bigger studio on more solid footing that sees the success and moves in, the same result would have happened.
The opposite is therefore more important to consider. Perhaps people interested in games look at the fangame and are interested in trying out the official version, boosting sales. Now you can say that isn't likely, and you could be correct. However, if you are correct, then at worst what's happened is nothing. At best the company is on a more solid footing going forward and can release better games, increasing their staying power long-term.
So as I see the three possibilities would be:
1. A significant portion of the audience leaves to play the free game, which is merely accelerating the inevitable if it happens.
2. Nothing, the fans play both because they love the games and want to support the people who make the official products).
3. There's a boost in interest as people try the free fan-game, like it, and try the actual games as well.
(There's technically a fourth possibility where people try the fan-game, hate it, and don't try the actual game, but in such a case they likely wouldn't have played the official game regardless, so I'm counting it under nothing).
For the broader question, sorta the same logic applies. Only with more dismissal of corporations and irritation with their rank hypocrisy on the topic.
So at worst, morally neutral.