Because we kept buying thinner and lighter phones, and gluing the battery in makes thinner and lighter phones with better battery life possible. As a convenient side effect glue creates a nice watertight seal that can make devices more water resistant.
I imagine it’s a hell of a lot cheaper/simpler/more reliable in manufacturing to use the adhesive over screws, gaskets, and grease. It reduces both the BOM and the number of processes required to ship a unit, and probably fails less often, which means fewer RMAs. Plus it just plain takes up less space, which leaves more room for the battery.
I don’t like it, my favorite phone I’ve ever had was a Galaxy Nexus with a zerolemon battery that was bigger than the phone itself, but I can see why gluing everything together would be an attractive solution for the engineers who design these things.