There is a dark side to Science as well. Nowadays, it is a “publish-or-perish” meritocracy. If you are a scientist, invest a lot of work on a new tool that gives you and advantage and then share it with others, what’s in it for you?
Well, if you keep it closed in your laboratory, it is true that nobody else will be able to use it, But you will need to disclose its existence on your first publication using it (and if you don’t use it for a publication, what us is it for your CV?), Then, it is a matter of time until someone else comes with a new implementation, and afterwards your advantage is over. Now, this other person did her own program, so she does not need to cite you. All you get is a short period during which you may be able to get another publication.
But if you open the software, what will happen? You lose that immediate advantage (how much, one, three months, one year?) but get to reap further benefits, and faster: first, once it is free and open, you discourage others from “wasting” efforts on building it (and advantage for them), but they will be forced to learn the tool (and perhaps request your help) and most relevant, to cite you in any and all subsequent works they make using your tool. And if they requested your help to learn, use, adapt or expanfd it, they will have to include you as author in any derived publication. As no one else will develop a similar tool now, you become the central hub for development: new collaborators will flock to your laboratory, and with them prestige, acknowledgement and publications.
So, what is best? Winning acknowledgement, collaborations, publications, citations and becoming the world’s reference point for a useful piece of software, or winning a short-lived advantage to get a new paper through with no extra citations and fading into oblivion?
It is worth noting that the same reasoning applies to private companies: by opening your software you reduce competition, become a reference point and increase your visibility, customers and benefits.