There is an accepted custom to perform a bris milah on a nefel prior to its burial. There are three reasons for this practice: 1) Remaining uncircumcised is a degradation for the baby. 2) Stillborn children will also awaken at techiyas hameisim, and if they remain uncircumcised, they will be unrecognizable as Jews. 3) The Medrash states that Avrohom Avinu will be able to save any circumcised Jew from Gehenom. In order to prevent Avrohom from saving circumcised Jews who deserve to remain in Gehenom, the foreskins of nefelim are placed on them, rendering them uncircumcised. We circumcise a nefel so that these foreskins are not available to be placed on the wicked.
[שו"ע תקכו, י, משנ"ב מח, ושעה"צ סד; ביאורים ומוספים דרשו, 48 ;קרב"נ מו"ק ג, פח, כ; (אג"מ יו"ד ג, קלח)]