Joseph Smith’s idea was that there was a true Masonry and an apostate imitation passed down from Cain and Lamech. “Restoration” of the Melchizedek Priesthood and temple ceremonies brought back the true priesthood. Quoting Michael Homer (1994): “According to Heber C. Kimball, Smith believed there was “similarity of preast Hood [sic] in Masonary [sic]” and that Freemasonry was “taken from [the] preasthood [sic] but has become degenrated [sic].”428 Benjamin F. Johnson, a Nauvoo Mason, also quoted Smith teaching that “Freemasonry as at present, was the apostate endowments, as sectarian religion was the apostate religion.”
Source: Michael W. Homer, “‘Similarity of Priesthood in Masonry’: The Relationship between Freemasonry and Mormonism,” Dialogue: A Journal of Mormon Thought, 27, no. 3 (Fall 1994): 70–71.