Diesel is not more expensive to make from a pure refining cost, but it is made of the same stuff, crude oil. Crude is by far the most expensive part. Gasoline is actually a volume positive product also, a gallon of fractionated feed stock can make more than a gallon of gasoline because it is less dense. Taxes have an affect. But those things only play a small part.
The big deal is that refineries were designed to make a bunch of gas and a little diesel, to match the market demands at the time. Remember most refineries are at least 40 or 50 years old, many date back to WWII.
Sure we've modified the heck out of them over the years to increase production and make cleaner products, but there wasn't any reason to make more diesel until about 18 months ago.
For a long time we could import diesel cheaply so there wasn't any incentive to spend billions to modify the plants. As more and more vehicles switched to diesel, the market demand shifted but the imports were still plentiful and relatively cheap.
Then markets abroad started using more and more diesel so we had to start competing for the imported diesel, so the price went up. Refineries have been modifying their process units to try and make more diesel and less gas, and that is starting to drive the diesel prices down finally but there is still more room to go.
It will eventually stabilize very close to gasoline prices, like i said the raw materials make up most of the cost to refine and help determine how profitable it is, hence how much refineries are willing to shift production. They will make whatever will make them money to the extent they are capable. Right now they are making some money on diesel and losing money on gas so they are making as much diesel as they can.
They still can't make as much diesel as they would like but it will take years and lots O'cash to make even more modifications. Cash is in tight supply right now and the refineries aren't spending anything on capital expenditures. It's too expensive to borrow money and they are barely profitable as it is, their stocks are way down. It's time to tighten the belt, not spend a few billion here and there.
Unlike someone we know