The backgound is not x-ray, but microwave. According to theory about 300,000 yrs. after big bang, the universe was cool enough for atmos to form. The universe was filled with radiation at a high temperature. As the universe expanded, the radiation cooled down to its present value (slightly under 3 deg. K). There doesn't seem to be any other explanation.
The velocities that you refer to are those of galaxies which are going away from us with speed proportional to distance - characteristic of an expanding universe, which started a little less than 14 bil. yrs ago.