Why is there a compressor in an air cycle machine?
If I understand your question correctly, you don't really understand how the ACM works.

The idea of an ACM is to create 'cool' air. Especially on the ground (imagine landing on your tropical holiday destination), this means that the air must sometimes be made cooler than the outside (ambient) temperature. The second law of thermodynamics (and in this case, the law of common sense) states that you can't just cool your air against the warm ambient air, so you will need to do some special tricks.

In this case, the special trick is compression. You compress the air, which will make it quite hot (increase the temperature) (search for adiabatic compression on the internet). Then, this hot air can of course easily be cooled against ambient air, which happens in the second heat exchanger. In fact, the hotter the air after compression is, the more heat is exchanged in the second heat exchanger. This means the heat exchanger can be made smaller, which is especially useful since air-to-air heat exchangers are inefficient and thus relatively big.

Now, you expand your air again, which will cool it (decrease the temperature). However, since you already cooled it down in the second heat exchanger, it will now be cooler than when it originally encountered the compressor! This makes sense, since you removed energy from the air in the second heat exchanger. So, this way, you can cool the air down further than would have been possible by a heat exchanger (search for reverse Brayton cycle on the internet).

So, this system has two advantages: 


It is possible to cool down air beyond ambient temperature, so it functions as 'airco' on the ground or at low altitude.
It is possible to cool hot compressed bleed air with a relatively small, light heat exchanger for pressurizing your cabin while not cooking your passengers medium-rare.