It did if she vowed it and St. Joseph was a righteous and upright man.
There is no evidence she vowed life long virginity.