The Bible condemns astrology as magically seeking to predict events and the fate of people as in horoscopes and the worship of heavenly bodies. But the magi of Matthew 2 may not have been astrologers. Observe that they undertook a dangerous voyage that span months simply to come and pay homage to the new king. They didn’t know how Israel received the king. To them, it perhaps was a thing of great expectation in Israel. And observe that they had understanding of the mysteries of God concerning the child king, his life and ministry as can be seen from the gifts they offer it: Gold, frankincense and myrrh. Gold spoke of his Kingship, incense (which is offered to deity) spoke of his Godhood, and myrrh his death. Pagans who had no connection with God could not have had these depths as unto demons it was not given to know the mysteries of the kingdom.
1 Corinthians 2:7 But we speak the wisdom of God in a mystery, even the hidden wisdom, which God ordained before the world unto our glory: 2:8 Which none of the princes of this world knew: for had they known it, they would not have crucified the Lord of glory.
The magi were wise men. Wise men were people who could unravel mysteries as in the case of Daniel in Babylon. What ever means by which the person could unravel mysteries and science whether by curious art or the spirit of God was of no moment; he was all the same called a wise man, and might even be seen as a magician. Consider the case of Daniel and the three Hebrew boys in which Nebuchadnezzar called Daniel the prince of magicians and thought that in him was the spirit of his gods, whereas Daniel and the other Hebrew boys were servants of the true God.
Like early Christians explained, a certain history traced the the magi of Matthew 2 to be descended from Balaam the Prophet who though a prophet of God out of greed meddled into curious art of divination when he was employed to place a curse on Israel by Balak, king of the Moabites (who were descendants of Noah).
He was a powerful and famous seer in the ancient world. He was an Arab from a town near the Euphrates. A fragmented plaster inscription about him was found in 1967 at Deir ‘Alla, Jordan, 25 miles north of the plains of Moab where the Israelites had camped. The inscription, dates to c. 800 BC. The long inscription begins thus: “The misfortunes of the Book of Balaam, son of Beor. A divine seer was he.”
He was of great reputation in the East and would have had many of his prophecies documented, including “A star will rise from Judah”. It could have been quite possible for prophecies of world and notable prophets to be written and anticipated by prophets, students and adherents of prophetic writings and mysteries. The same is true of the prophecies of Isaiah, Jeremiah and a host of others. Daniel learned by Jeremiah’s works of prophecy the appointed time of the deliverance of Israel from their captivity in Babylon, just to cite an instance, and the fulfilment of some of the prophecies of Daniel are still being anticipated by Christians all over the world today. The magi may have been wise men but not of the curious art of astrology as they were not predicting the birth of Jesus by the star but realizing the fulfilment of an age-long prophecy– the visible unusual star which appeared in the east — determined to trace and worship the God-promised king of the Jews. The wise men may have been familiar with astrological divination of the East, like Moses and Daniel were familiar with the wisdom of Egypt and Babylon respectively but may not have practised it nor derived their wisdom from that source. Balaam himself was once a genuine prophet of God before he later lost his standing with God by dabbling into divination and enchantment for greed sake.
Commenting on Luke 2:28 an early church father Ambrose of Milan writes :
But who are these Magi unless those who, as a certain history teaches, derive from the stock of Balaam, by whom it was prophesied “a star shall arise out of Jacob” [Num 24.17] ? Therefore these are heirs not less of faith than of succession. He saw the star in spirit, they saw it with their eyes and believed
Corpus Scriptorum Ecclesiasticorum Latinorum 32/4, p. 67-68.2
Another church father Origen also affirmed a similar position in his homilies on Numbers 13:7 thus:
If Balaam’s prophecies were included in the sacred books by Moses, how much more would they have been copied by those who were then living in Mesopotamia, among whom Balaam had a great reputation and who are known to have been disciples in his art. It is said that the race of Magi descends from him, and that their institution flourishes in eastern lands, and that they [the Magi] had copied among them all of Balaam’s prophecies, including “A star shall arise out of Jacob” [Num 24.17]. The Magi had these things written among themselves, and so when Jesus was born they recognized the star and understood that the prophecy was fulfilled.
Origen reiterated the tradition that the magi descended from Balaam and that their institutions flourished in the East. All being said, we conclude that the magi couldn’t have been astrologers but wise men whose understanding of mysteries and signs was by their knowledge of the true God of Abraham, for in the second coming of Christ God will also give heavenly signs. Realize that there are other cases in the Bible in which the stars and planets are used by God to reveal His desires, e.g Isaiah 38:6-8. And I will deliver thee and this city out of the hand of the king of Assyria: and I will defend this city. And this shall be a sign unto thee from the LORD, that the LORD will do this thing that he hath spoken; Behold, I will bring again the shadow of the degrees, which is gone down in the sun dial of Ahaz, ten degrees backward. So the sun returned ten degrees, by which degrees it was gone down.
Psalm 19:1–6 affirms that the heavens declare God’s glory, and Romans 1:18–20 teaches that creation reveals God’s existence. Christ made reference to what will happen to the sun, moon, and stars in connection with His second coming (Matt 24:29–30), similar to this is the prophecy of Joel the prophet ( Joel 2:31–32). The star guiding the Magi was not given by God for divination, but to proclaim the birth of Christ.