The pasuk states (Bamidbor 24:3): ‘Thus said Bilaam the son of Beor. Thus said the man with the stuffed eye.’ Although the pasuk seems to be saying that Bilaam was blind in his eye, Onkelos translates it to mean ‘the man who could see well.’
The Baal Shem Tov zy’a explains by citing the words of Rashi: ‘Why did Hashem let His Shechinah dwell on a non-Jewish rasha? So that the nations of the world would be unable to complain and say that if they had been given a prophet, they would have acted properly.’ He explains that for someone to receive prophecy, all of his senses must be pure and holy. If one has sanctified all of his senses, he can have the holy spirit of prophecy enter into him, but if he is impure, he cannot experience this.
All of Bilaam’s senses were thoroughly impure. Chazal say that he engaged in witchcraft and all sorts of depravity. Accordingly, he could not experience the spirit of prophecy. However, Hashem had to give the non-Jews a prophet so that they wouldn’t have a complaint. So what did He do? He blinded one of his eyes, making it impossible for him to sin with this eye. Therefore, he was able to receive prophecy only through this one eye. When the Targum says that he could see well with this eye, it means that because he was blind in this eye, he was able to see prophecy through it.
If a decadent non-Jew like Bilaam could receive holy prophecies through his blind eye, it is certain that one can experience incredible holiness if he guards his eyes and does not allow himself to see forbidden things.