It's just the easiest way to construct a "modern" phone. Stick the battery in with a 3M Command Strip style sticker and it won't move, construct phone around it.
Having to add toolless latches while keeping some kind of IP rating AND not looking like a rugged phone is a whole different thing.
How quickly we forget history. I'm not going to say they were the absolute first to do this as I'm not doing a full survey of 2007 phones, but before that (a) there was not a single phone I or my friends had that didn't have a simply replaceable battery and (b) there was a ton of conversation and press when the iPhone was first released about how unique the decision was to have a glued-in battery here.
For contrast, here are instructions for replacing the battery on the famous Nokia 3310 https://devices.vodafone.com.au/nokia/3310-2017-proprietary-....
Let's be real here: if having difficult-to-replace batteries was a money loser for Apple and other manufacturers, they would fix the situation in a heartbeat - it's not like this is a hard problem. The only reason they do this is because of desired planned obsolescence - tons of people will think "Oh, getting the battery changed is such a hassle, might as well get a new phone."
Again, essentially every consumer electronic device pre-2007 (except maybe some Mac laptops?) had easily-replaceable batteries. Convincing people that using glued-in batteries was a necessary design change, instead of a corporate decision to make more money, was a real coup for corporate marketing.
I'm in no way saying Google or Samsung is better in any way here, and in many ways Apple has improved their repairability scores over the past few years. The reason I highlighted Apple was because they really led the way in gluing down batteries everywhere, but the problem is definitely industry-wide now.
Compared to a modern iPhone you can throw in a pool and dig out safely a few minutes later.
Batteries post 2007 have gotten REALLY good, the capacity/weight ratio has gone up so much that swapping batteries mid-day isn't a thing people do. Drones weren't a big thing in those times because you couldn't get enough power to lift one up. Now a 249 gram DJI drone can fly ~45 minutes on a single battery that's about the size of 2-3 matchboxes.
I still remember the laptop I had around that time that had two batteries so that I could swap one and still keep it running with the other.
On the other hand my current M2 MacBook lasts for two full workdays without charging easily, even more if I just sit in meetings and don't do anything CPU/GPU intensive.