Choosing Java made a lot of sense when Android got started. The binary architecture for mobile devices was not standard in any way, ARM, MIPS, x86 were all in common use at some time or another. And nowadays AArch64 (which is not the same as older ARM) is quite widespread. Plus there was nothing like WASM back then, so if you wanted binary independence for apps and the like you were stuck with something very much like Java.