Because heat is just averaged kinetic energy
When you have an average impulse of a bounce on one side of a piston exceed the average impulse of a bounce on the other side you get a net force in the direction from the side with bigger bounces to side with smaller ones
When gas "exerts work" it pushes a piston, when you bounce off something which moves away from you your resulting speed is slower, and since on average the speed of a molecule decreases so does the "heat" of a gas
The exact opposite is when "work is being exerted on the gas", when you bounce off something which moves towards you your resulting speed will be faster, and thus piston compressing a gas by moving towards it makes molecules faster and thus gas gets more "heat"
Since gas molecules move around randomly we cant use any methods other then statistical to take away their average impulse
There are however ways to do this when movement of molecules is no longer completely random, for example doppler shift allows us to make molecules recieve different wavelengths depending on the direction of their movement, and many other destructive wave interactions in specific conditions all of which can be called "laser cooling"
>https://en.wikipedia.org/wiki/Laser_coolingTheoretically its possible to take away energy of individual molecules, youd just need a structure about the size of the molecule you need to cool, and that structure, when hit by a molecule, needs to negate the recieved impulse by emitting something which can not(or at least extremely unlikely to) transmit impulse back on surrounding molecules(like say a neutrino or gravitational wave), the problem is that such a structure would need to be made of parts much smaller than atoms, and we dont have that in our universe(at least we think so right now)