5 “But when Herod was dead, behold, an angel of the Lord appears in a dream to Joseph saying, Arise, and take the young Child and His mother, and go into the land of Israel.”
He no more says “fly,” but “go.” Do you see again after the temptation refreshment? Then after the refreshment danger again? In that he was freed indeed from his banishment, and came back again to his own country; and beheld the murderer of the children brought to the slaughter; but when he has set foot on his own country, he finds again a remnant of the former perils, the son of the tyrant living, and being king.
But how did Archelaus reign over Judæa, when Pontius Pilate was governor? Herod's death had recently taken place, and the kingdom had not yet been divided into many parts; but as he had only just ended his life, the son for a while kept possession of the kingdom “in the room of his father Herod;” his brother also bearing this name, which is the reason why the evangelist added, “in the room of his father Herod.”
It may be said, however, “if he was afraid to settle in Judæa on account of Archelaus, he had cause to fear Galilee also on account of Herod.” I answer, By his changing the place, the whole matter was thenceforward thrown into shade; for the whole assault was upon “Bethlehem and the coasts thereof.” Therefore now that the slaughter had taken place, the youth Archelaus had no other thought, but that the whole had come to an end, and that among the many, He that was sought had been destroyed. And besides, his father having come to such an end of his life before his eyes, he became for the future more cautious about farther proceedings, and about urging on that course of iniquity.
Joseph therefore comes to Nazareth, partly to avoid the danger, partly also delighting to abide in his native place. To give him the more courage, he receives also an oracle from the angel touching this matter. Luke, however, does not say that he came there by Divine warning, but that when they had fulfilled all the purification, they returned to Nazareth. What then may one say? That Luke is giving an account of the time before the going down to Egypt, when he says these things. For He would not have brought them down there before the purification, in order that nothing should be done contrary to the law, but he waited for her to be purified, and to go to Nazareth, and that then they should go down to Egypt. Then, after their return, He bids them go to Nazareth. But before this they were not warned of God to go there, but yearning after their native place, they did so of their own accord. For since they had gone up for no other cause but on account of the taxing, and had not so much as a place where to stay, when they had fulfilled that for which they had come up, they went down to Nazareth.
Source: Homilies on the Gospel of St. Matthew (New Advent)