This is the point of the historical lesson. Melchizedek exercised faith, and received the priesthood, then taught his people. It is not impossible that Melchizedek might have, at some point, shared in his people’s wickedness. If so, then he and Alma have an even stronger connection. Perhaps the Ammonihahites knew about a repentant, then triumphant Melchizedek, through their copies of the brass plates scriptures, and certainly they would have known about Alma’s miraculous conversion. Thus, Alma’s selection of Melchizedek as a model seems apt on several levels. The point, of course, is that Melchizedek’s people ultimately repented and believed. It is that belief and repentance that Alma is urging upon the Ammonihahites.
Reference: There is an interesting difference in this verse between the Melchizedek tradition Alma is using and Paul’s oral tradition. In Paul, Melchizedek is “without father, without mother, without descent, having neither beginning of days, nor end of life” (Heb. 7:3). Alma 13:7 echoes some of this language, but he is referring to the priesthood, not to the person: “This high priesthood being after the order of his Son, which order was from the foundation of the world; or in other words, being without beginning of days or end of years.… ”
Furthermore, Alma clearly indicates that Melchizedek reigned “under his father” (v. 18). Thus, Alma clearly gives Melchizedek a father, while Paul equally clearly says he was fatherless. Alma’s source is less supernatural while Paul’s has the appearance of a longer oral tradition that has accrued supernatural trappings. The difference in the passage of time between Paul and Alma is sufficient to explain the differences.