Heat pumps allow shifting the temperature that's in the cooling and heating circuits, so you can extract (or add) more heat, making it more effective. This is used to cool data centers and heat homes/offices, so it also allows to move heat between places instead of always having to have a cold sink and a heat source.
Sure, there is electricity warming up the water, but earlier the energy that was used to cool a space was just discarded into the air, now it's gathered and put into the circuit to be useful elsewhere.
Not a gimmick, it saves _a lot_ of energy.