Though it is true that the acidic pH, gastric juice, etc will digest immunoglobulins, please consider also that a newborn does not have a mature digestive system yet. It has never really learned to
completely process food yet. By way of compensation, as if mother nature has thought of this already, the digestive system of neonates allows the absorption of macromolecules temporarily. These macromolecules are absorbed in the ileum. Now in the case of colostral immunoglobulins, absorption happens only a short period of time after birth--the time of baby's first suck. Absorption is initially high then declines gradually just so to accomodate the infusion. From there, intestinal absorption of the immunoglobulins eventually will no longer be accomodated. This period is known as the "time of closure".
Same reason why mothers are encouraged to breastfeed the baby as soon as both become ready for their first mother-child intimacy interaction. They call it "rooming-in".