If CMB photons are in equilibrium why is there a temperature variation of the background? The CMB has the blackbody radiation spectrum which implies that the CMB photons are in equilibrium. Blackbody distribution amounts to an equilibrium distribution. If there is equilibrium, the CMB must have the same temperature everywhere. But CMB contains temperature anisotropies at the $10^{-5}$ level. 
How am I supposed to reconcile thermal equilibrium of a system (the CMB) with temperature differences in the system? 
 A: It is exactly that, what makes the CMB interesting. Namely its anisotropy puts bounds on how large can the regions in thermal contact be. If a certain region of the universe was in thermal equilibrium, that region should have a well defined temperature, but this doesn't imply that all regions should be in equilibrium a priori, however this $10^{-5}$ temperature anisotropies precisely leads us to the conclusion that probably all the observable universe was in equilibrium (or very close to it, equilibrium is an idealized concept, real life happens at its best very close to it) at some point for which you need causally connected regions. This in turn led later to inflationary models for example. 
EDIT:
Perhaps the this also helps you understand why it is produced in equilibrium. The following is an abstract from "Physical Foundations of Cosmology" by Prof. Mukhanov, speaking about the Universe's Milestones:

$\sim 1$ s ($T\sim 0.5$ MeV) The typical energy at this time is of order the electron mass. The
  numerous electron–positron pairs present in the very early universe begin to annihilate
  when the temperature drops below their rest mass and only a small excess of electrons
  over positrons, roughly one per billion photons, survives after annihilation. The photons
  produced are in thermal equilibrium and the radiation temperature increases compared to
  the temperature of neutrinos, which decoupled earlier.
$\sim 10^{12}–10^{13}$ s. At this time nearly all free electrons and protons recombine and form neutral
  hydrogen. The universe becomes transparent to the background radiation. The CMB
  temperature fluctuations, induced by the slightly inhomogeneous matter distribution at
  recombination, survive to the present day and deliver direct information about the state
  of the universe at the last scattering surface. Helium, which constitutes about 25% of the
  baryonic matter, has recombined and become neutral before this time. After helium recombination
  there remain many free electrons and the universe is still opaque to radiation.
  Helium recombination, therefore, is not a very dramatic event, though we must take it
  properly into account when calculating the microwave background fluctuations because
  it influences the speed of sound.

A: 
How am I supposed to reconcile thermal equilibrium of a system (the CMB) with temperature differences in the system?

This is the basic argument for invoking the inflation period in the Big Bang model.
The equilibrium reflected in the CMB is a snapshot at the time of the expansion of the universe when the  photon decoupled, at about 380.000 years:

The problem you point out is even more serious, because  black body radiation, (ignoring the tiny inhomogeneities,)  is the same from all places of the observable universe, BUT at that time special relativity did not allow for homogenisation. Many regions were outside the light cone that would allow homogenizing thermodynamic processes.
The quantum mechanical hypothesis of inflation was proposed in order to homogenize in energy density the early universe, the inhomogeneities attributed to quantum mechanical uncertainties. This model needs quantization of gravity, and at the moment effective models are used. 
The observed  inhomogeneities are the seeds for the observed  coagulation of matter into clusters of galaxies and galaxies, in the Big Bang model.
