Why is the gas halo of the Milky Way so hot? I have read on the webpage of NASA that there is a massive hot gas halo around our galaxy. Its temperature is between 100,000 and 1 million Kelvins or more. I do not understand why is it so hot. The temperature of the cosmic background radiation is only 2.7 Kelvins. The stars of our galaxy warm it up or one (or more) process in the gas?
UPDATE: The question is about circumgalactic medium (CGM) not about the gases within our galaxy.
 A: You want to read this. A quick excerpt from it:

The ISM (Interstellar Medium) is usually far from thermodynamic
  equilibrium. Collisions establish a Maxwell-Boltzmann distribution of
  velocities, and the 'temperature' normally used to describe
  interstellar gas is the 'kinetic temperature', which describes the
  temperature at which the particles would have the observed
  Maxwell-Boltzmann velocity distribution in thermodynamic equilibrium.

A: The article linked in the question refers to the hot gas surrounding the galaxy, in what is known as the circumgalactic medium (CGM). The CGM, in turn, draws in gas that has undergone gravitational collapse and shock-heating during the process of structure formation.
Older version of answer concerning the gas within the galaxy:
The hottest regions of the galaxy are most likely heated by supernovae. A classic paper that describes how the three thermal phases of the interstellar medium ("cold," "warm", and "hot") are maintained, and invoking a connection between the hot phase and supernovae, is McKee and Ostriker 1977. See also this page for some helpful visuals. The high-velocity gas ejected in a supernova explosion collides with the gas in the surrounding interstellar medium, shocks, and heats up to millions of Kelvin.
Finally, some of the supernova-heated gas can flow back out of the galaxy and into the CGM, causing it to harbor metals which could only be produced by stellar evolution.
