Why do babies and older children need vitamin d?

PEOPLE need it. Not just babies and children. The reason we need it is that our skin makes it when exposed to sunlight in the proper wavelength. When you live in a temperate climate and spend much of your time indoors and/or clothed, you are likely deficient. Vitamin D isn't just for bones. It acts as a hormone that helps to regulate the immune system, and you shouldn't be without it.
Deficiency. Babies are dependent on milk , and breast milk is deficient in Vit D, hence the need for supplementation .
For good health. All humans need vitamin d. Unless you or your child is out in the sun when it is strong enough to get a slight sunburn, you will not have enough vitamin d. Vit d helps prevent infections including colds and the flu. It may also help prevent diabetes and obesity in children and adults.