Jesus said that to hate in your heart equaled murder.
To look on a woman with lust was equal to adultery.
Mary perhaps could have been perfect enough to not act out sin, but if the thoughts and intents of her heart were not completely pure, she sinned those sins.
Sin isn’t just outward actions.
God looks at all of sin the same. All it takes is the breaking of one commandment to be guilty of them all.
James 2:10-11 “ For whoever keeps the whole law and yet stumbles at just one point is guilty of breaking all of it. For he who said, You shall not commit adultery, also said, You shall not murder. If you do not commit adultery but do commit murder, you have become a lawbreaker. “
Mary sinned otherwise she wouldn’t have needed a savior.
Can you imagine ANY child (except Jesus, of course) who never committed a willful act? The whole idea is preposterous! :)