Because the universe is expanding and this causes the background temperature to decrease. The ratio of the temperature and the peak wavelength of its black body distribution is a constant,
k
Constant = ------ T x wavelength
hc
which means as the expansion 'stretches' the
wavelength of the light making it longer, its temperature must decrease
as well.