Why do clouds have areas of darkness instead of scattering light to produce a rainbow?
It really depends on the cloud. Actually, it depends on its density and thickness which is related to concentrations and type of hydro-meteors in it, the size distribution of water droplets and ice crystals, and shape of ice crystals.

Rainbows are formed by the refraction and internal reflection of light in water drops (usually rain).

But cirrostratus clouds can form a halo by refraction on ice crystals in shape of hexagonal prisms. These halos have angular radius of about 22 degrees.

Another optical phenomena that you might find interesting is a corona around the Sun or the Moon which is caused by diffraction of light on water droplets and tiny ice crystals. Angular size of a corona depends on the size of water droplets.

'Areas of darkness' are due to the density and optical thickness of a cloud. More ice crystals and water droplets cause more scattering which results in less light reaching your eyes making a cloud appear darker.