It's part of us being social creatures. Why do we have conversations? Why do we socialise? Why do we do anything that isn't stritcly essential? Because that's how most humans are. There's pleasure to be had in sharing, seeing others, exchanging information, and just human contact. There's plenty of negative possibilities too of course, but that's life, and they can be mitigated against in various ways (as others have said above, using watermarks to reduce copyright infringements, controlling who sees what with filters, etc).
More specifically in my case, though I share much less than I used to (mainly because I take far fewer photos), I have seen that others respond in positive ways when I post stuff, and I enjoy seeing others' output, so it's for the benefit of us both. I've also learned a huge amount - a lot of my online contacts are botanists, bird watchers, and others involved in nature recording and education, and I've found that the constant trickle of images of plants, animals, weaher phenomena, etc. is an excellent way to learn identification skills, and sharing one's own pics is a part of that. Finally, it's a great way of experiencing the world if you haven't the means or the time to go to all the places and see all the things for yourself. We live in a golden age of recording - but without sharing, next to nobody sees most of it.