Because someone thought apps (web or otherwise) having access to battery status information would, in the usual language, "allow us to improve the user experience", and that feature was added. It's the same justification as for GPS location, except in this case those who opposed did not notice that someone could use battery status for exploiting and profiling users too.