Long haul trucking and railroads use diesel instead of gasoline engines for a reason - the higher density of diesel contains more energy per unit volume.
Marine diesel is not typically the same as highway diesel for this reason; the push for higher cetane ratings and lower sulfur in highway diesel reduces the aromatics content and therefore the density, but also decreases the resistance to ignition.
Marine fuel oil (and heavy fuel oil in general) has higher density - you can see some of the heaviest grades are "heavier than water" - if they were liquids at 15°C, and even the heaviest grade has a maximum pour point of 30°C / 86°F so it's still not really "tar / asphalt". There is a lot of energy per unit volume available in heavy fuel oils for propulsion across the oceans (or generating electricity in a fuel oil powered generator as another example).
FWIW, the term "bunker fuel" is a holdover from when oceangoing vessels had actual coal bunkers with men shoveling coal into the furnaces.