Unless you're Argonne Laboratories, putting gasoline into a diesel fueled car is a bad problem.
Maybe it was brain fade. Perhaps you rented or borrowed an unfamiliar car. Or you simply didn't realize that nice Volkswagen or Mercedes-Benz was a new, clean-diesel car. (It also happens to particularly stupid car thieves.)