Ergodic and localized regions in quantum spin glasses on the Bethe lattice