I agree, but, again canon law which, comes from those decrees, states, 2335,……which plot against the church or legitimate civil powers, incur….excommunications. Another problem was that the Bishops did not enforce the law, that’s why there were so many bulls issued on it.
Also there were no Free masons during St. Thomas’s life time, though he may have written about other secret society’s?? Pope Pius IX was considered a liberal and help spread democracy in the papal states. He changed his opinion after anarchy and rioting broke out.
With Pope John 23, I can not find any evidence that he was ever a mason. If he did it would have been after he became an Archbishop. Then we would have to investigate the lodge he belonged to and find out if it falls under the excommunication law. One thing I found was that he was assigned by Pope Pius XII as an observer at the United Nations in 1951, Educational, Scientific, and Cultural organizations. I do not have any conclusive evidence that Pope John 23 was never a Pope.
In Christ, Joseph