And ran greedily after the error of Balaam for reward,

According to Jewish exegetical tradition, Balaam is proverbial for his greed, so the false teachers (rather, false prophets) with their desire for gain are compared with him. According to Numbers 31:16 he was also guilty of leading others into sin.