Situations where you can't really turn your engine off. Like I once had my car battery die and after a friend jumpstarted it, I was gonna go drive around for a bit to charge the battery but then I realized my gas tank was completely empty. So I had to fill it up while it was running.
A rare situation for sure, but it's at least one reason.
According to myth busters, smoking in and of itself is also not a problem when pumping gas. Cigarettes don't burn hot enough to light gasoline. A lighter CAN light gasoline tho (obviously).