Nye's Encyclopedia of Secrets makes a reference to Joseph Smith considering Masonry while he was a young man in Manchester NY. Before starting the Church of Latter Day Saints, what connections did Joseph Smith have to esoteric groups such as Masonry? What influences did these have upon the development and doctrines of the LDS?
It is a very small cross-section of people who are well versed in Mormon theology and early church history, the history of the freemasons, and browse /r/AskHistorians. I am not a certified Mormon historian nor a Freemason. But as it has been several hours and none have attempted to really reply to your question, I'll give you some background information:
The freemasons were no secret in upstate NY where the Smith family lived during the early 1800s. Though their organization was/is structured and esoteric, it was not uncommon for men (from politicians to lower-class) to join a lodge. There were many reasons men chose to join a lodge, not the least of which was simple fraternity. George Washington, Benjamin Franklin, Paul Revere, and many others including many Presidents joined masonry.
[The Joseph Smith family] was a Masonic family which lived by and practiced the estimable and admirable tenets of Freemasonry. The father, Joseph Smith, Sr., was a documented member in upstate New York. He was raised to the degree of Master Mason on May 7, 1818 in Ontario Lodge No. 23 of Canandaigua, New York. An older son, Hyrum Smith, was a member of Mount Moriah Lodge No. 112, Palmyra New York.
*~ The Mormon Church and Freemasonry (2001), Terry Chateau*
Interestingly, however, an incident occurred in the 1820s that sparked a wave of anti-masonry. A man claimed he was going to publish the masonic "secrets" (rites and symbols) ...and then went missing. Some blamed the masons for his death. This spark was fanned both by religious groups who just so happened to be going through a massive religious revival, and an anti-Jacksonite political party as (Jackson was a mason) who were running non-masonic candidates. The sentiment and political party largely diminished after a few years.
Perhaps consequently, Joseph Smith himself was not a member of the masons when he organized the Church of Jesus Christ of Latter Day Saints (the Mormon church) in 1836. In fact, the Book of Mormon even seems to strongly condemn secret, oath-bound organizations . But many members of the church (which soon numbered in the thousands) were already members of Masonic lodges before joining. In fact, Brigham Young, successor to Joseph Smith, was one of those cases.
In 1839, the saints built up a city called Nauvoo, IL and grew in numbers. This was a relatively peaceful period in their history (a rare circumstance for the controversial church). It was during that period that a man named John Bennett came to Nauvoo and eventually joined the church. He pushed to create a lodge in Nauvoo.
The first meeting of the new lodge took place on December 29, 1841.
Joseph and Sidney [Rigdon] were inducted into formal Masonry ... on the same day..." being made "Masons on Sight" by the Illinois Grandmaster.("Is There No Help for the Widow's Son?" by Dr. Reed C. Durham, Jr., as printed in "Joseph Smith and Masonry: No Help for the Widow's Son", Martin Pub. Co., Nauvoo, Ill., 1980, p. 17.)
"On Sight" simply meant they were not required to fill all the typical requirements to gain status as a mason. Then, in March (three months later), Joseph Smith continued to rise in masonic status. He writes:
Tuesday, [March] 15. — I officiated as grand chaplain at the installation of the Nauvoo Lodge of Free Masons, at the Grove near the Temple. Grand Master Jonas, of Columbus, being present, a large number of people assembled on the occasion. The day was exceedingly fine; all things were done in order, and universal satisfaction was manifested. In the evening I received the first degree in Freemasonry in the Nauvoo Lodge, assembled in my general business office. History of the Church (Joseph Smith)|History of the Church, by Joseph Smith, Deseret Book, 1978, Vol.4, Ch.32, p.550-1)
And the next day:
"Wednesday, March 16.—I was with the Masonic Lodge and rose to the sublime degree." (History of the Church, Vol.4, Ch.32, p.552)
After that, the Mormons largely embraced masonry:
"The introduction of Freemasonry in NAUVOO had both political and religious implications....Eventually nearly 1,500 LDS men became associated with Illinois Freemasonry, including many members of the Church's governing priesthood bodies—this at a time when the total number of non-LDS Masons in Illinois lodges barely reached 150." (Encyclopedia of Mormonism, vol.2, p.527)
Joseph introduced new ordinances to be performed only in holy temples which many feel are overwhelmingly clearly influenced by the symbolism used in masonic rites and procedures. This ordinance is called the Endowment. Joseph claimed that the masonic rites were an 'apostate' version of the Endowment, similar to how he felt other religions were apostate or fallen. He preached that the Endowment contained anciently revealed principles that the masons were influenced by. Overall, he felt the Endowment ordinance as he introduced it was a 'purer' form of ritual - one focused on exaltation, rather than human fraternity.
Doctrinally (ie, theologically), there does not appear (to me - personal analysis) to be much borrowed. Rather, one will find that the Mormon theology is rather contextualized to common early 19th century religious ideas.