I do not know for certain the symbolism of the skull-and-crossbones on the papal casket, but I can say with certainty that it is not there to indicate allegiance with Masonry, a religion the Catholic Church has long encouraged its own members to have no part of. Besides, a skull-and-crossbones does not only indicate Masonry. You’ll also find the emblem on everything from bottles of poison to pirate flags. What it usually symbolizes is death.
Although I cannot say for sure, my educated guess is that the papal skull-and-crossbones is meant to symbolize death and also recall that skulls are sometimes crafted at the foot of crucifixes. When an image of a skull is at the base of a crucifix, it recalls the pious legend that Adam was buried on Mt. Calvary, which would later become the scene of the Crucifixion. It symbolizes that all men eventually die but will find their hope of eternal life in the cross of Christ. This pious thought may be one of the reasons why a skull and crossbones are engraved into one of the papal caskets.