If temperature is the average translational kinetic energy of matter , then how does space have a temperature what are we measuring in deep space , that's if space if a perfect void.
Saying that temperature is the average translational kinetic energy of matter is misleading, since this is not the definition of temperature, it just happens to be true for certain systems. When we speak of the temperature of space (~2.7K), it means that the blackbody radiation that fills space (the CMB) has a Planckian spectrum with that temperature.
Space does not have a temperature in that sense. The background EM of open space has an average temperature of around 3 K--but note that this is a blackbody temperature. If an object is allowed to float in free space with no other incoming source of energy, it will eventually cool to this temperature by radiating away its inherent thermal energy. It can't get cooler than that because the ever-present background radiation will keep it at 3 K.