It's fun. If you can find joy in coding, you would most likely enjoy discussing said code with others, getting feedback, learning about it, improving it, etc. Open sourcing code makes all this possible and easy, and when there are no ulterior business motives to keep your code in safe, what is there to lose?