The trouble is that you're comparing apples and oranges, or rather efficiency of electricity generation with efficiency of heat generation. Remember that thanks to heat pumps, electric heating can often have greater than 100% efficiency, so waste heat is less useful than the same amount of electrical energy even for heating.