Simple answer, one needs to walk, the other doesn't. A giraffe can also walk almost immediately after birth for that same reason, because if the herd migrates it'd be left behind, it also wouldn't be able to reach its food source if it couldn't. Many bugs, like roaches for example, need to move around during their young stages because their parents aren't there and they need to make it to the adult stage. Roach nymphs require access to water and also have NUMEROUS predators, if they couldn't walk, they'd just die- That's like asking why a caterpillar or silkworm can move, they simply need to do that in order to survive. With a human baby, we've evolved to have a parenting system, this is seen in some other animals like birds which also start off fairly helpless.