Work done on a system (like compressing gas) increases its internal energy. Increased internal energy in a gas manifests as increased temperature and thus increased average kinetic energy of the molecules.