Measuring the temperature in space is more complicated than just using a thermometer, since temperature is only a meaningful figure when heat can be efficiently transferred from one body to another. In space, while the temperature of particles (molecules) can be very high, their density (or number of them) is very low so the ability to transfer heat is minimal. They could be at millions of degrees in the Kelvin range, but since they so rarely collide with one another, the actual phenomenon of temperature or heat exchange doesn't take place. The temperature in space therefore has to do with the movement and concentration of the molecules, which in turn determines how often they collide with one another to gain or lose energy.
But since the Hubble telescope is made up of its own molecules the "heat" from the sun would transer heat directly to it.
But even if it didn't every once in a while a super heated molecule would hit the Hubble
and burn a hole right through it.
Now you know.