I would imagine (although I have no data to back this up), that the majority of contributors to open-source scientific programs are scientific researchers themselves. They are building tools to scratch their own itch. Hence it is win-win for them to build  tools that contribute to their own research.