I am not justifying anything but I think that the target audience of the tax-free work is important to the IRS when classifying the organization. Like others have said, they may get exemption with some tweaks, but simply "not being bad" doesn't make it good, if you think of it from the point of view of a loophole that other companies can take advantage of, it's important to the IRS to avoid loopholes like that, it has nothing to do with good or evil, just with money and avoiding taxes :)
Why it is a loophole? I thought giving stuff to the public is the whole point of the nonprofit status, why you're calling it a "loophole"? Yes, of course businesses benefit from it too - they are part of the public, businesses are run by people and serve people, so whatever makes people's lives better helps businesses too. If the government says that it would not tax activities which benefit the public, it is extremely weird to say "unless of course it benefits all the public and not just narrow subset of it". I'd say it makes more sense to encourage activities which benefit everybody, not suppress them. As is it sounds like IRS would be happy to welcome an organization that gives software for free only to people living in New York and unemployed, rather then giving it to everybody. I don't see how it makes any sense - the benefit for the society is clearly larger in the latter case and that's the whole point why nonprofit status exists in the first place!
It isn't inherently a loophole, I never said that, I said from the point of view of the IRS it could open up a loophole, possibly.
Giving to the public isn't the point of nonprofit status, there are lots of different kinds of nonprofits, and the one under discussion here is a very specific kind, and in order to qualify for it, the IRS requires a lot of specific things.
From what I understand, the issue the IRS has is the fact that the recipient of the charity was too broad, and to qualify for 501(c)(3) status, the recipient of the charity should be more targeted.
Think of it this way, I could give away free food all day, but if I'm doing it at the top of a ski resort, it probably doesn't help the kind of people who need free food and my case for being considered a charity may be diminished.
There is nothing to say that companies doing open source can't qualify, many have, and they obviously did so with better lawyers and maybe a more concrete/directed plan as to who would receive the charity they are offering.
The IRS isn't concerned with the benefit to society, that's not what they are regulating, they are regulating the flow of money and exemptions to taxation. Software that is tax free and used by entities which may exploit that are what the IRS is probably considering.