Preparing to build the Temple required gathering massive quantities of raw materials to guarantee the structure's stability and strength. King David collected an enormous supply of iron specifically to forge pegs [מצודת ציון] and nails. Although iron was disqualified from being used to craft the Temple vessels themselves, it was essential for the building's structural components, which demanded exceptional strength and height [ביאור שטיינזלץ].
The primary approach among commentators is that this iron was used to connect and reinforce the wooden elements of the building. There are different perspectives on how these metal joints were applied. Some explain that the iron secured the doors and gates, holding them firmly in place [רש״י]. Others suggest the nails were used to fasten the wooden boards to one another [רד״ק, מצודת דוד], particularly the heavy cedar planks used throughout the construction [רלב״ג]. Another approach suggests that the iron was formed into tools or large structural beams designed to link various sections of the building together.
In addition to the iron, David accumulated an extraordinary amount of copper. The sheer volume of this metal was so vast that it was impossible to determine its actual weight, or the builders simply chose not to weigh it at all because the supply was so overwhelming [מצודת דוד, ביאור שטיינזלץ].