We have no idea of the true greatness of the wicked Bilam. Bilam? He was a great man! He was the goyim's version of Moshe Rabbeinu, so-to-speak! And so much so, that Chazal have to specify (Avos 5:19): Ma bein talmidiv shel Avraham Avinu litalmidav shel Bilam haRasha, "What is the difference between the students of Avraham Avinu and the students of the wicked Bilam," as if it is a question! And even more so, it appears as if on the outside there was not even much of a difference at all between Avraham and Bilam themselves lihavdil, so much so that we had to go to their students to find the distinction! What is going on here?!
The answer is very simple: someone who learns Torah but does not learn mussar can fool everybody...except for Hashem.