Moving heat does take energy, true.
A restive electric heater (AKA joule heating) is by definition 100% efficient: All energy consumed by the device is turned into heat (if you're mega-pedantic, you could argue some is lost as light and sound).
A heat pump just moves heat from outside to inside. Sure, it's 42*F out, but that's still heat energy that can be moved. This process is more efficient than converting electricity into heat because you get more heat energy in the room than the electric energy you put into the device.
https://en.wikipedia.org/wiki/Joule_heating#Heating_efficien... explains it even better than I did.