Personally, I add a license ASAP to everything I do, and everything I do is public by default. I use permissive licenses (e.g. BSD-2 or ISC or MIT) unless I have a compelling reason to do otherwise. I only leave something private for legal or security reasons (e.g., secret tokens or passwords). And in those cases, I encapsulate the smallest possible piece of “infected” code that must remain secret, and make the rest public.
Reasons to use a copyleft license like GPL include:
- A dependency is copyleft, and thus the downstream code also must be so.
- You want to enable a dual-licensing model—see e.g. Bio-Formats, which uses a dual GPL/commercial license. In this way, open-source projects can use the copyleft license, while commercial projects can purchase a commercial license. This only works if all copyright holders continually agree to make the software available under both licenses, though.
- You agree with Richard Stallman about pragmatic idealism.
Personally, generally speaking, I lean more and more toward the minimal copyright restrictions possible; I would love to make everything we do public domain if possible with something like the Unlicense, but there are legal reasons that doing so is generally impossible when you work for an institution rather than yourself.
A major reason I like to minimize restrictions is because I want to maximize the impact and utility of my work. If my work is GPLed, then many companies cannot adopt it and will instead rewrite. Similarly, permissive projects such as ITK cannot adopt or port GPLed work, and instead will choose to rewrite it. My feeling is: I do not want to waste my life releasing a thingamabob only to have someone else rewrite it for legal reasons.
As a counterpoint: I have had long philosophical debates with others who disagree with me about permissive licensing being the best way to maximize impact. Such people feel that copyleft will have a greater total impact over the long term. Ultimately, I do not think this is an trivial argument to make in either direction.