A "diesel only" label could mean that the pump is not rated for volatile fuels. Gasoline is highly volatile and will readily ignite with any spark. Diesel will not. Or possibly a tank that does not meet FDOT standards for gasoline fuel tanks. Most fuel tanks I see are rated for both, but there might be differences in the requirements for gas vs diesel. Read more about FDOT fuel tank certification on the Transfer Flow website:
https://www.transferflow.com/regulations
More often, though, it's just a preventative to warn against putting gas in a system that normally contains diesel, i.e. a diesel genset.