As the name implies, a heat pump
moves heat around. When you heat your house with a heat pump, you're not (just) converting electricity into heat. The electricity is being used to move heat from outside your house into the house. You make the interior of the house warmer while making the exterior (very slightly) colder. It's exactly the same as an air conditioner or refrigerator, just pointed the other way.
Of course, energy has to be expended to move heat around, and there are inefficiencies. But with real-world equipment and common cold-but-not-too-cold temperatures, a single unit of electricity can be used to move several times as much heat as it would produce if you just converted it to heat directly.
A computer is as efficient as anything when it comes to converting electricity to heat. Heat pumps win because they're ultimately playing a different game.