One of the roles an angel fulfills is to call the wicked to repentance (see Moroni 7:29, 31). Note that the angel did not come to Alma and the four sons of Mosiah because of their righteousness but “that the prayers of his servants might be answered according to their faith” (Mosiah 27:14).
The ministering of angels must be in harmony with the will of God and does not always occur according to the timetable of the petitioner. Speaking of a man who had prayed for the visitation of angels, President Wilford Woodruff (1807–98) said:
“I said to him that if he were to pray a thousand years to the God of Israel for that gift, it would not be granted, unless the Lord had a motive in sending an angel to him. I told him that the Lord never did nor never will send an angel to anybody merely to gratify the desire of the individual to see an angel. If the Lord sends an angel to anyone, He sends him to perform a work that cannot be performed only by the administration of an angel. I said to him that those were my views. The Lord had sent angels to men from the creation of the world, at different times, but always with a message or with something to perform that could not be performed without. I rehearsed to him different times when angels appeared to men. Of course, I referred to the angel visiting Joseph Smith. The Revelator John said that in the last days an angel would fly in the midst of heaven, having the everlasting Gospel to preach to them that dwelt on the earth. The reason it required an angel to do this work was, the Gospel was not on the earth. The Gospel and the Priesthood had been taken from among men. Hence God had to restore it again.
“Now, I have always said, and I want to say it to you, that the Holy Ghost is what every Saint of God needs. It is far more important that a man should have that gift than he should have the ministration of an angel, unless it is necessary for an angel to teach him something that he has not been taught” (“The Administration of Angels,” in Brian H. Stuy, comp. Collected Discourses, 5 vols. [1987–92], 5:233).