This is the specific cannon regarding funerals:
THOSE TO WHOM ECCLESIASTICAL FUNERALS MUST BE GRANTED OR DENIED:
$1:
Can. 1176 §1. Deceased members of the Christian faithful must be given ecclesiastical funerals according to the norm of law.
§2. Ecclesiastical funerals, by which the Church seeks spiritual support for the deceased, honors their bodies, and at the same time brings the solace of hope to the living, must be celebrated according to the norm of the liturgical laws.
§3. The Church earnestly recommends that the pious custom of burying the bodies of the deceased be observed; nevertheless, the Church does not prohibit cremation unless it was chosen for reasons contrary to Christian doctrine.
Can. 1177 §1. A funeral for any deceased member of the faithful must generally be celebrated in his or her parish church.
§2. Any member of the faithful or those competent to take care of the funeral of a deceased member of the faithful are permitted to choose another church for the funeral rite with the consent of the person who governs it and after notification of the proper pastor of the deceased.
§3. If a death occurred outside the person’s own parish, and the body was not transferred to it nor another church legitimately chosen for the funeral rite, the funeral is to be celebrated in the church of the parish where the death occurred unless particular law has designated another church.
Can. 1180 §1. If a parish has its own cemetery, the deceased members of the faithful must be buried in it unless the deceased or those competent to take care of the burial of the deceased have chosen another cemetery legitimately.
§2. Everyone, however, is permitted to choose the cemetery of burial unless prohibited by law.
Can. 1181 Regarding offerings on the occasion of funeral rites, the prescripts of can. 1264 are to be observed, with the caution, however, that there is to be no favoritism toward persons in funerals and that the poor are not deprived of fitting funerals.
Can. 1182 When the burial has been completed, a record is to be made in the register of deaths according to the norm of particular law.
Can. 1183 §1. When it concerns funerals, catechumens must be counted among the Christian faithful.
§2. The local ordinary can permit children whom the parents intended to baptize but who died before baptism to be given ecclesiastical funerals.
§3. In the prudent judgment of the local ordinary, ecclesiastical funerals can be granted to baptized persons who are enrolled in a non-Catholic Church or ecclesial community unless their intention is evidently to the contrary and provided that their own minister is not available.
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.
§2. If any doubt occurs, the local ordinary is to be consulted, and his judgment must be followed.
Can. 1185 Any funeral Mass must also be denied a person who is excluded from ecclesiastical funerals.
This only applies to the religious rites. The respect for the body exists for all of humanity.
I guess the argument of public scandal was the basis for the decision, extremely weak though.
Edit: Full text