It's so annoying that Google strips the geolocation data. What would be the reason for this? It has been frustrating following along with the ticket that goes nowhere for years: https://issuetracker.google.com/issues/80379228
As andybak says, almost certainly privacy. It's very easy for an unsophisticated user to share photos that, for example, effectively show where they live (or where someone else lives). I believe Facebook strips geo data as well. (A service like Flickr does not although I assume there is a switch somewhere that tells it to.)
Well it's being done through the API, which is presumably OAuth'd under your name, but again, this API is generally used by other sites to interact with your photos library, and it's very easy for someone to just approve the OAuth permissions for sharing photos, not realizing they are also implicitly sharing their location.
One scenario is you're at a party at someone's house. If you post a captioned photo from the party that's geotagged, you're identifying where they live.
Ironic indeed. I can’t help but wonder if Google stores the geolocation data privately where only they can access it for their own data mining uses before removing it from the photos.
You can see the location on Photos website/app, it's not hidden from the user. You also still get it when you Takeout the photos. It's explicitly stripped when sent through the API, because said API is generally used by other websites for getting your photos, and it's not clear to the user they are actually leaking their location when uploading a Photo to "ShareYourRecipe.com".
I would start with the assumption that Google is collecting and storing every single possible data point about every single thing you share with them, including this. I have zero doubt that they store this info privately for their own use.