It is nice to give back to the community. Open source software is largely of better quality than closed source. Other people can freely use and distribute these tools and libraries. Writing libraries and reusable code makes you a better software craftsman.