Started out in 1717 as a gentleman's dinner club for the intelligencia to bridge religious sectarian issues. Ultimately due to the freedom of speech on hot issues it opened the door to address what were seen as three of the worst ills of society: cown, tiara, and mob. It also became a place for mysticism, magick, and all kinds of research and addresses to the big issues shut down by the organized church that people were seeking answers on (not too far off from what a lot of people are trying to do now) and due to that they wove in a lot of Egyptian, Hermetic, Qabalistic, and Rosicrucian degrees albeit outside orders tend to debate that the mysticism/occultism is pretty watered down.
Apparently English and US Masons ended up being a very different lot than what were considered continental European. US and English were more based on John Lock, continental European were heavily influenced by Rousseau and a lot of the animals such as the French Revolution, Marxism, etc. came out of the continental European flavor.