Because any machine that has an implementation of the JVM can run any program that's been compiled into Java Byte Code (in theory). Java byte code also acts as a higher-level language that different languages can compile into. Of course, different languages can be compiled into the same machine-code, but that ties compiled code to one type of machine, instead of non-machine-specific byte code.
The JVM implementation also takes care of the machine specific details instead of the app programmer. This allows Java code to do away with the 32/64 bit code variations that are typically resolved using preprocessors in c/c++.