There have been accounts written by those who have converted to Catholicism after having been freemasons. One such tale was of a GM in a ‘lodge’ and he said that nominees had to answer questions in which whomever was joining were to state opposition to the Church and the core tenets of Catholic belief.
As far as I am aware, from having looked up the relevant Church documents, freemasonry, while not explicitly stated in later years as being an excommunicable offence, for those who join or remain, is implied, with the original excommunication not having been overridden.
One cannot be a freemason and an authentic Catholic witness, because freemasonry opposes the Church over her core beliefs, and over the centuries has promoted in society, anti-life agendas, and anti-God movements, too, such as Humanism.
The Bible states that people are not to have rituals. Freemasonry rituals constitute idol-worship.
Also, freemasonry encourages deceit, known by its secrecy and rules. And these secrets are protected to a dangerous level, whereby, anyone who shares certain secrets, or wishes to leave, will have pressure put on them (to put it mildly).
The organisation began in Europe, apparently, and was originally made up of stone masons, or so it is said. Maybe it is that they started out as a kind of workers union, and at some point became a place where people could solicit work and favours. Who knows and really, who cares, why. Catholicism is straightforward in the sense that we know when we are doing something against the faith. Maybe not everyone back in the Middle Ages, or whenever it was that freemasonry began, had available, printed Bibles, for them to read Scripture and see, quite obviously, that joining such an organisation was wrong.
Not a far cry from the Mafia - members of which, have been excommunicated - except possibly more dangerous, long-term, because of the secrecy and subtlety in which their aggressive agendas are slipped into society behind the scenes:
Likening freemasonry to a slithering snake does not make for a bad analogy.