Mormons can be Masons, and in fact many early leaders of the Church of Jesus Christ of Latter-day Saints were Masons. In the early days of restoration, political control of the local Masonic lodge was part of the contention between Mormons in Nauvoo, Illinois and their neighbors. The political role that Masonry played at that time contributed to the assassination of church leaders Joseph and Hyrum Smith. When the next church president Brigham Young led the Saints to settle the Mountain West of the United States, they did not immediately establish a Masonic lodge. Rather, the lodge was established by the first groups of non-Mormon settlers, and played a part in the political establishment of Salt Lake City as a counter-point to the Mormon majority. That Masonic lodge excluded Mormons from joining until the mid-twentieth century. In this environment, some Church leaders saw the Masonic groups as being anti-Mormon and discouraged members from joining. As far as I know, this was never official Church policy.
As stated earlier, many early leaders of the Church of Jesus Christ of Latter-day Saints were Freemasons. When Joseph Smith introduced the temple endowment in Nauvoo, one leader referred to the practice by letter as a restoration of "True Masonry". Though early Mormons used Masonry as a template for restored temple worship, there are significant differences between the two sets of ordinances.
As a teenager active in the Mormon faith, I was interested in joining the local Masonic lodge. My father encouraged me to wait until after I had attended the Mormon Temple to see if I still felt like I needed anything more. I still have an interest in Masonry, but don't have much time for additional fraternal organizations outside of my service in the LDS Church, professional groups, kids sports teams, etc. However, I know faithful Mormons who are Masons. They find that both ceremonies share some common metaphors, but play very different roles in their lives.
There are two really good articles on this topic in the Encyclopedia of Mormonism, available here: