Freemasonry has been condemned by the Church since 1738 (see Clement XII, In Eminenti):
Wherefore We command most strictly and in virtue of holy obedience, all the faithful of whatever state, grade, condition, order, dignity or pre-eminence, whether clerical or lay, secular or regular, even those who are entitled to specific and individual mention, that none, under any pretext or for any reason, shall dare or presume to enter, propagate or support these aforesaid societies of Liberi Muratori or Francs Massons, or however else they are called, or to receive them in their houses or dwellings or to hide them, be enrolled among them, joined to them, be present with them, give power or permission for them to meet elsewhere, to help them in any way, to give them in any way advice, encouragement or support either openly or in secret, directly or indirectly, on their own or through others; nor are they to urge others or tell them, incite or persuade them to be enrolled in such societies or to be counted among their number, or to be present or to assist them in any way; but they must stay completely clear of such Societies, Companies, Assemblies, Meetings, Congregations or Conventicles,** under pain of excommunication for all the above mentioned people, which is incurred by the very deed without any declaration being required, and from which no one can obtain the benefit of absolution, other than at the hour of death, except through Ourselves or the Roman Pontiff of the time**.
The last reaffirmation of this was in 1983, after the current code of canon law was published.
It has been asked whether there has been any change in the Church’s decision in regard to Masonic associations since the new Code of Canon Law does not mention them expressly, unlike the previous Code.
This Sacred Congregation is in a position to reply that this circumstance in due to an editorial criterion which was followed also in the case of other associations likewise unmentioned inasmuch as they are contained in wider categories.
Therefore the Church’s negative judgment in regard to Masonic association remains unchanged since their principles have always been considered irreconcilable with the doctrine of the Church and therefore membership in them remains forbidden. The faithful who enrol in Masonic associations are in a state of grave sin and may not receive Holy Communion.
It is not within the competence of local ecclesiastical authorities to give a judgment on the nature of Masonic associations which would imply a derogation from what has been decided above, and this in line with the Declaration of this Sacred Congregation issued on 17 February 1981 (cf. AAS 73 1981 pp. 240-241; English language edition of L’Osservatore Romano, 9 March 1981).
I think it is somewhat a scandal to grant an Ecclesiastical Funeral to one who was an active Freemason up to his death. I say it is a scandal, as it could lead members of the faithful to having an incorrect belief that Freemasonry is compatible with the Christian Faith. Per the Code of Canon Law:
Can. 1184 §1. Unless they gave some signs of repentance before death, the following must be deprived of ecclesiastical funerals:
1/ notorious apostates, heretics, and schismatics;
2/ those who chose the cremation of their bodies for reasons contrary to Christian faith;
3/ other manifest sinners who cannot be granted ecclesiastical funerals without public scandal of the faithful.
Having said that, the pastor is in a far better position to know what was going on than I, as an anonymous Internet poster, do (as in he may have repented of his membership in the masons on his deathbed). But, based upon what you say above, it seems utterly scandalous that both a Masonic funeral and a Catholic funeral would occur.