The heat emitted by the electronics will always be emitted and needs to go somewhere. If 1MWh of that heat is dumped into district heating how would that be less efficient than the 1MWh being dumped in the atmosphere to (hopefully) be reclaimed by a heat pump elsewhere?
Or, alternatively, that 1MWh could be absorbed by the already existing datacenter AC coils which could ultimately still be used to heat up district water as it cools the refrigerant. (People actually do this with swimming pools, using the coils from their AC to heat the pool).