Gasoline has a flash point of -43°C (-45.4°F) and an autoignition temperature of 280°C (536°F). This means that gasoline is more volatile and can ignite more easily than diesel fuel.
Diesel fuel is also denser than gasoline, so it will not vaporize as easily and create a flammable mixture with air.
Finally, diesel engines are designed to run on a lean fuel-air mixture, which means that there is less fuel present in the cylinder to burn and create an explosion. In comparison, gasoline engines run on a richer fuel-air mixture which makes gasoline engines more prone to knocking and detonation.
These factors all contribute to the fact that diesel fuel is less explosive than gasoline.