 The Midrash explained that the Torah records Balaam’s story to make known that because the nonbeliever prophet Balaam did what he did, God removed prophecy and the Holy Spirit from nonbelievers.The Midrash taught that God originally wished to deprive nonbelievers of the opportunity to argue that God had estranged them.So in an application of the principle of “The Rock, His work is perfect; for all His ways are Justice,” God raised up kings, sages, and prophets for both Israel and nonbelievers alike.