Hats are actually indispensable for a baby. Because a baby's head has the largest body surface area in proportion, a bay regulates the temperature through the head. Especially with a newborn baby, a hat may be necessary to keep yourself in good temperature.
A baby normally also has relatively little hair, so it is quickly cold to go outside without a hat. In the summer, a hat protects the fragile baby skin from burning.