Plant for CO2 purification and compression