The Wiki page on the spread of Islam in Indonesia stresses that our knowledge of this macro-historical process is fragmentary, for instance often we don’t how the religion diffused out into the general populace after a ruler converted. Bali seems to be the most prominent example of non-conversion, as opposed to say Java, earlier the site of the Hindu kingdom Majapahit. Javanese courts like the one in Yogyakarta retained a lot of Indic cultural features like court ritual, dance, and costumes while becoming Muslim. What prevented Balinese courts from going the same route?
Possible factors: Bali was isolated from the trade routes that spread Islam; conditions after the fall of Majapahit made Bali a refuge for fleeing Javanese aristocrats; charismatic Hindu mystics like the Shaivite Dang Hyang Nirartha (see Wikipedia) helped rejuvenate Hinduism on Bali at the same time as Java was going Muslim. And if not at that time, why not later as with Lombok and other islands to the east?