Torque is one of the main considerations when vehicles or machinery are designed to use diesel engine. High torque is needed to move heavy loads. While Torque is defined as a measure of how much force acting on an object causes that object to move. 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. Thus diesel engines have comparatively larger compression ratio, as a result it has a larger offset in crankshaft, resulting in higher 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 its 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.
The only real draw back to this torque production is a limited RPM. This is compensated by a gear box with lots and lots of gear.
If a gasoline engine was used it would have to be much larger. The much larger engine would make for greater fuel consumption.