If you pull a baby tooth out, how come you don't have to do anything to the hole to keep from getting infection?

Depth. Usually it is very shallow and less likely to collect debris and cause probs. Children also heal much faster than adults so the hole closes faster than adults.
Closes itself. It will close itself up. Just like when kids loose teeth on their own.
Saliva. The saliva contains enzymes that suppress germ growth.The shallow hole is bathed by a constant flow of saliva limiting the chance anything would have to take hold. There are certainly germs that pass through, but this is rarely a problem.If it isn't broke, we shouldn't try to fix it.