Petrol is popular cos its ability to produce power quicker than diesel could because of faster combustion rate. More suitable for lighter cars where u need to accelerate
quick. In trucks, they can't accelerate quick but many trucks indeed have more torque to pull tons of loads than most race cars.
In the past, diesel was also associated with dirty and smoky combustion. Now the combustion has been improved especially in Benz TDI engines, so smoky engine is no longer an issue, providing a regular service is maintained. But still for acceleration, in general
diesel will loose to petrol engines, but in load pulling
ability, diesel win upper hand.
Basically two different engine for two different purpose.
The market determines which type of car majority of consumers would prefer to have...