A good way to think about it would be "useful" energy vs waste energy. The energy used by a chiller to cool a cellar is useful energy. The heat (energy) that is removed from the cellar and rejected to the atmosphere is waste energy.
The defendant was stealing useful energy and returning waste energy.
Heat is not a desirable form of energy in this context, it's either a waste product created by the cooling system, or a naturally occurring element that is counteracted by the saline solution.
Maybe the judge isn't technically wrong, he just got it backwards. The energy here is expended to eliminate heat, while creating it would be the opposite endeavor.
Is this the reason why?