Halifax Harbor is completely encircled by the cities of Halifax and Dartmouth. The Beirut explosion occurred on the shore so half of the blast's shock wave essentially had no effect.
Watching video, the possibility that Beirut's grain silo absorbed or reflected much of the blast also occurs. The vapour cloud showed a gap immediately above the structure in initial moments.
Also filled with up to 120,000 tonnes of energy-absorbing, high-dispersal mass: the grain itself.
Something like a 20-storey Hesco.
Most regular buildings, and quayside warehouses in particular, are surprisingly lightweight and contain comparatively little material, as the remnants of a demolition will frequently attest.