We see that St. Joseph was given instruction by the Lord in dreams, as follows:
But after he had considered this, an angel of the Lord appeared to him in a dream and said, “Joseph son of David, do not be afraid to take Mary home as your wife, because what is conceived in her is from the Holy Spirit. (Matthew 1:20 - NIV)
When they had gone, an angel of the Lord appeared to Joseph in a dream. “Get up,” he said, “take the child and his mother and escape to Egypt. Stay there until I tell you, for Herod is going to search for the child to kill him.” (Matthew 2:13)
After Herod died, an angel of the Lord appeared in a dream to Joseph in Egypt. (Matthew 2:19)
But then we also see that St.Mary was directly met by the Angel of the Lord during the Annunciation.
One might argue that the role that Joseph was assigned with, as both the foster father and the guardian of infant Jesus, was no less important than the role that was given to Mary. Given that, I wonder why Joseph was not given instructions in person by an angel. Do the teachings of the Roman Catholic Church mention anything to explain the difference?