Teachings of the Prophet Joseph Smith, pg. 319; “Here is a little of law which must be fulfilled. The Levitical Priesthood is forever hereditary—fixed on the head of Aaron and his sons forever, and was in active operation down to Zacharias the father of John. Zacharias would have had no child had not God given him a son. He sent his angel to declare unto Zacharias that his wife Elizabeth should bear him a son, whose name was to be called John.”
Matthew 5:17; “Think not that I am come to destroy the law, or the prophets: I am not come to destroy, but to fulfil.”
Okay the latter part of his teaching really has nothing to do with what his main point was about.
The Levitical priesthood was indeed hereditary but the Law was bankrupt, thus Jesus coming to fulfill all righteousness…
BTW – John the Baptist was not qualified to be a priest because of his lifestyle. Hair, clothing and his dietary intake disqualified him.