The basic purpose of a heatsink is to remove heat from the core of your CPU. Therefore, metals with good heat transfer properties are ideal for use in heatsinks. Heat transfer or thermal conductivity is measured in W/cm-K (watts per centimetre per degree Kelvin). Thermal conductivity relates to how well a metal can absorb and transfer heat within itself. Different metals conduct heat differently because thermal conductivity is strongly driven by the interaction of electrons throughout the material.
In the case of (most) metals, electrons are shared as members of a collective 'whole' in which they float rather freely from on atom to the next. The more easily these electrons can move through the atomics, the better that metal will conduct heat. The small table below compares the thermal conductivity of a few different metals:
While diamond and silver conduct heat the best, most manufacturers have opted to make their heatsinks mainly out of aluminium. This is because aluminium is much easier to obtain, not to mention significantly cheaper. Can you imagine how much you would have to pay for a heatsink made out of pure diamond? Copper has also become a very popular material among heatsink manufacturers because it features good thermal conductivity properties and costs a fraction of what you'd be paying for silver, gold or diamond. However, as copper is much harder to machine than aluminium, a lot of manufacturers have stayed away from it to keep production costs down.
Another thing manufacturers look at when designing a heatsink is the thermal convection properties of a metal. While thermal conductivity refers to how well a metal absorbs and transfers heat within itself, thermal convection refers to how well a metal transfers the heat to a liquid or gas (for example, air). Air unfortunately does a rather poor job of conducting heat, which is why we usually see fans attached to the heatsink. When an object such as a fan is used to force the air across the heatsink, it is called forced convection.
The final important thing to look at when deciding on a metal for a heatsink is its ability to emit radiation. Radiation is the emission and propagation of energy in the form of rays or waves. In the case of a heatsink, the energy that is going to be emitted is heat. Black objects tend to emit energy very well. This is why we have seen many black coloured heatsinks in the past. That doesn't mean you should go out and paint your heatsink, as this will greatly reduce its effectiveness because the paint will act as an insulator.
Heatsinks get their colour from a process called anodizing, where their surface is coated electrolytically with a protective or decorative oxide. While a black heatsink will emit large amounts of radiation, most of the heat will be dissipated using convection. The performance difference between an anodized black heatsink and an identical heatsink of a different colour will be negligible. Other than looking cooler. And who wants to compromise performance for aesthetics?