Diesel has a higher energy density and is cheaper to produce on a total life cycle cost basis (it requires less treatment to get high quality diesel).
However, those costs include construction of the refinery. Once the units are built to crack the crude and achieve today's relatively high octane ratings, the CAPEX is spent and profit is maximized by selling as much product as possible. The balance between diesel and gasoline is determined during design of the refinery, by selection of catalysts and treatment technologies.
Until a few years ago, gasoline was expected to be the dominant fuel in passenger vehicles for the US. Therefore, billions of dollars have been invested in upgrading refineries to maximize gasoline production.
It will take years to modify the US refineries to significantly reweight their product mix towards diesel. Some minor changes can be achieved by modifying process parameters like reactor operating pressures and temperatures, but these have most likely already been done as the popularity of diesel passenger cars has increased.