I'd be interesting in seeing some research reports about this, but without further information I'd assume it's extrapolating some rare corner case into likely behavior.
No matter how hard you hit diesel (or gasoline) with a shaped charge, shell fragments or whatever, it won't explode. Just like for a regular fire, an explosion needs both fuel and oxygen (and an ignition source, which surely the shaped charge or hot shell fragment can provide, so lets not worry about that here). To get a liquid hydrocarbon fuel to explode, you need to vaporize it together with an oxygen source (like air, for an obvious choice). Now contrary to movie physics, while shooting at a fuel tank can cause an explosion, it's actually quite rare and difficult to achieve. But the mechanism for diesel and gasoline is a bit different. Gasoline is very volatile, with a DVPE (dry vapor pressure equivalent) somewhere in the 40-90 kPa range typically), and the ullage in the fuel tank (the empty space above the liquid fuel level) saturates with fuel vapor beyond the rich flammability limit. Heavy fuels like diesel, OTOH, are very non-volatile, typically with a DVPE below 1 kPa, and thus in a "normal" situation there isn't enough fuel vapor in the fuel tank ullage to go above the lean flammability limit.
Now, it is possible to make a heavy fuel tank explode (see e.g. the TWA 800 airline disaster), but such situations typically involve heating the fuel which increases the evaporation, and can thus lead to a situation with an flammable oxygen-fuel mixture in the tank.
In a situation where a fuel tank is hit and does not immediately detonate, gasoline would be much more dangerous as it's much more likely to result in a fire, either by the shell that made the hole in the first place, or by fuel leaking onto some hot component in the engine bay, or some electrical component etc.