It's not just gasoline. Many of the Metrocard vending machines in the NYC subway ask for the zip code when buying or topping up metrocards. Now interestingly enough, although I might be wrong on whether this is still so, originally you could not use a credit card if you're at a station (and they're fewer and fewer) which has an attendant....many stations don't leaving somebody without a zip code out of luck and forced to pay cash.
Of course and this dates back a couple of decades....I remember one time my credit card was cloned and the first transaction was a $1 charge for gasoline. It took me a few seconds to realize the piece of garbage sub-human who had cloned the card was just checking to see if it worked......