Up until a couple of years ago, I rarely if ever turned off any vehicle I was re-fueling. The above post regarding mixture/fuel richness in this atmosphere etc is one reason. The other is that fuel vapors (the dangerous part) will in many cases be swept under/into vehicles and also into the engine area. If the vehicle is running, the sources for ignition are alternator, 12v ground circuit (battery, very low current flow when engine running, unless battery is discharged) and lights (maybe, and very low chance for arcing) and the ingition system (plug wires, rotor (or electronic). Not to mention the fact that there may be a viscous fan (or electric) running to blow away any fumes before they even reach a source of ignition.
Now lets look at a vehicle that is shut off. If there are any fuel vspors that are around, and may have had a chance to get to a dangerous place (engine bay) when you go to crank over the engine we have the starter motor (big current. lots of arcing), the metal teeth on the starter gear engaging the flywheel (could be a spark), the ground circuit (battery, big current flow), alternator (now full fielding to recharge battery), lights coming on (better chance for an arc than if they were already on)
I explained this to several "gasoline technicians" who would not fill my car while it was running, and I was rewarded with puzzled stares. Some would fill it, some wouldn't. With my MB I only go to self serve anyway, so usually not an issue.
I think the reason for turning off the vehicle is that there are a small percentage of drivers that are just plain idiots. I have watched people drive away from the pumps with the hose still in the tank (those hoses can REALLY stretch) Whether turning off the car would have prevented this, I do not know. Another reason could be for the safety of the attendants (safety from these same sort of drivers "accidentally" popping a car into gear and running someone over)
If I leave my car unatended and runnning, the doors are locked and if the vehicle has an alarm or brake switch kill, it is activated, even if I am only a few feet away. It only takes a second.
All of this is just my speculation, and of course everyone is free to have their opinion. For me, the less my car has to be turned on and off, the better. Cars tend to last longer that way.