Simplified: Energy is stored as heat in matter (the jostling of atoms and molecules) and there are many more water molecules under the bridge than there are molecules/atoms in the bridge. So both the water and the metal heat up during the day and cool down at night, but since there is much more water, the water has a much more stable temperature. In short: Larger volumes of atoms have larger heat capacities.
If the water under the bridge was stagnant and a shallow puddle, then it’s temperature would vary much more throughout the day as well, but it would still warm up less than metal or soil, since a body of water loses some of it’s heat through evaporation.
This is also why coastal climate is a thing: the huge mass of water in the ocean makes it so that coastal areas are warmer in the winter and cooler in the summer.