Torque is the name of the game. High torque is needed to move heavy loads. If comparing a gasoline engine to a comparable diesel engine the diesel will always have higher torque. The higher torque comes from the need for a higher compressing ratio needed for compression ignition. To achieve the higher compression ratio a longer stroke is required. The longer stroke comes from a greater crankshaft offset. This offset gives greater torque.
Another aspect is that diesels can make tremendous torque at very low RPM. Very simply put more fuel equals more torque when everything else is kept the same. A diesel does not have throttle plates and draws in the maximum amount of air on every stroke. In a diesel the amount of fuel added is what controls the power. The throttle controls how much fuel is added. This means that a diesel always runs lean. At idle the engine uses hardly any fuel. This lean mixture allows for the addition of large quantities of fuel even at low RPM. A gasoline engine on the other hand always has to keep the fuel mixture at optimal stoichiometric. This need to keep the mixture correct means that to get more fuel the engine needs to rev to higher RPMs. This means that a gasoline engine makes it's torque at much higher RPM than a diesel. This high end torque characteristic makes a gasoline engine hard to drive necessitating constantly keeping the RPM high.