This question was answered previously in Chinese. See http://askfrfrancis.org/qa/why-difference-between-zechariah-and-mary-after-hearing-message-from-angel. The following is the English version.
The Catechism does not provide a clear explanation on this. There are different views out there. The following is my observations.
Though the two events are similar, there are some significant differences. First of all, Zechariah and Elizabeth had been asking God to grant them a child for a long time. Why was it that when God finally answered their prayer through the Archangel Gabriel, Zechariah would not believe? Shouldn’t he be thankful and joyful instead?
Conversely, Mary had never asked to become the mother of the Messiah. It would be reasonable and prudent for her to be cautious with Gabriel’s message.
At the time of Gabriel’s visit, Elizabeth had long passed menopause. It would be fair to conclude that Zechariah’s unbelief stemmed from him having given up on God answering their prayer, not believing that God could act outside of natural law.
Moreover, there is also a parable for Zechariah to be struck dumb. The child to be born to them was John the Baptist, who was “the voice of one crying in the wilderness”. Hence, Zechariah needed to be silent before the “voice” for the Messiah was born.
And in the conversation between Mary and Gabriel, if we look more closely, she was not acting out of doubt, but rather was concerned if the message was truly the will of God.
When Gabriel said she was “full of grace”, in her humility, she naturally felt uneasy since it could be the voice of the devil tempting her to pride.
And then when the angel told her that she would conceive and bear a son, she said, “How could this be, since I do not know man.” This is absurd, since she was already engaged to Joseph. In the Jewish custom, engagement is similar to marriage. The couple may live together and procreate. Having children in the near future for Maria should not have been a foreign idea. And remember, at this point, the angel had not mentioned how Mary would conceive her son, so naturally she would think the son would be conceived with Joseph.
But in the original Greek, what she actually said was “I will continuously not know man”. The only explanation for her to say that, then, is that before the angel’s visit, Mary had already promised God perpetual virginity. That’s why when the angel told her that God now wanted her to conceive a son, she had to understand how this could be compatible with what God had previously asked her to do, which was to remain a virgin.
From this, we can understand why Gabriel had to give a long explanation to Mary, and encourage her with the miraculous conception of Elizabeth that nothing would be impossible for God—in this case, virginal conception—, since otherwise, Mary would have thought she would conceive with Joseph after they lived together.
We can now see that the initial fear and apparent disbelief of Mary did not come from doubt, but instead was the perfect prudent response of one who sincerely seeks to do God’s Will, and only God’s Will. God could not possibly ask for two mutually exclusive things: a virgin and a mother. Mary needed to be assured that this was not some trickery of the devil, but that it is truly God’s Will. And once Mary understood that this was to be a miraculous act of God, she surrendered and accepted unconditionally: “Behold, the handmaid of the Lord. Let it be done unto me according to your word!”
Lastly, a question may arise here: if Mary had made a vow of perpetual virginity previously, why then was she engaged to Joseph?
I have answered this one elsewhere before. So, here, I only give a skeletal response:
– First of all, Mary’s perpetual virginity was believed in the Church’s tradition since the first centuries, especially among the Greeks. It was believed that she was consecrated as a young child and stayed in the Jerusalem Temple to learn until just before puberty, and it was during these early years that she made the vow of perpetual virginity.
– Custom required that all girls must be married, so it was possible that Mary’s engagement to Joseph was arranged by her parents or the priests
– It was possible that those who arranged her marriage did not know that she made such a vow, or at least ignored it, since it was absurd to Jewish custom.
– It was also possible that Joseph knew Mary made such a vow, and was prepared to enter into a chaste marriage with Mary.
– And one can really appreciate the shock to Joseph when he first discovered that Mary was pregnant, and how righteous and obedient to God this righteous man was in the subsequent events.