In fact, there are two questions here: why are most rockets white? Conversely, why are some rockets not white? A white outer colour is useful to minimise heat absorption into the body of the rocket. For rockets that use fuels at very low cryogenic temperatures, such as liquid hydrogen and liquid oxygen, even very small amounts of heat introduction can result in the liquid fuel ‘boiling off’ into gas and being lost. Europe’s Ariane 5 rocket launches from French Guiana in South America, so reducing heat input to the rocket in that hot, tropical climate is important.
However, painting the surface of your rocket white adds weight to the rocket, which you want to be as light as possible, so you only do it when it brings real benefit. You can have rockets which are part white,