I invited a delivery driver into my house just to be nice and so he could place the food on my counter, but he told me he wasn't allowed to come in, why?

There's a number of different reasons. The first being that it's generally store policy. Pizzerias don't want their semi-stoned junior college dropouts that are masquerading as employable individuals wandering around the homes of customers. They're obviously afraid that we'll steal your collection of vintage Time magazines that span an astounding two decades. And even if we don't actually make off with your wall of Precious Moments figurines, the store doesn't want to be inadvertently saddled with some inane lawsuit about how we supposedly committed some bullshit crime. See, the idea is, if we stay out of the homes of customers, the con-artists of the world can't accuse us of thievery. That's when the leverage that they might have had over our store sifts through their shifty little pizza-less fingers. I don't blame store owners or corporate offices for taking these kind of precautionary measures. Drivers are uneducated animals that need a full inventory on eBay to sell to fund their Oxy habit. At the same time, customers usually fall squarely into the category of Jurassic World aficionados that live to complain there way into free meals at the expense of their fellow man; making upper management's paranoia about any kind of trespassing, permitted or not, 100% understandable.
Honestly, nobody tends to follow these archaic no entry rules anyway. If we refuse to help lug your food into your house it's because we have other valid reasons to ignore your polite invitation besides The Man cracking his whip from some boardroom in Ann Arbor. Having a house that smells like a Motel 6 maid made love with an unneutered cat is one of those reasons. For whatever reason it seems that the majority of courteous customers that insist on us assisting them in their home tend to be homeowners that have more cats than NFL DB's have illegitimate children. The reason that cat lovers feel compelled to usher us inside their homes is unclear, but what is crystal-fucking-clear is that these zealots always seem overly willing to share their pungent palace with as many innocent outsiders as possible. Eau de Asparagus Fed Tom Cat is the only way I can properly describe the general smell of these shanties. In their defense, there is a somewhat plausible scientific explanation for the inability to associate one's own home with the smell of ammonia and kitty litter. There's  a parasite called Toxoplasmosis that appears in the feces of cats courtesy of the rodents that they devour. The parasite is believed to have a subtle effect on it's human hosts. It's actually thought that the infection can alter our personality in a somewhat profound way that includes inhibiting our self-control and personal awareness. Or these feline fans are simply trying to lure us in and feed us to their two dozen tabbies. Either way, just fucking stop. Please. I don't like the smell of urine and you obviously aren't fond of fresh air. That makes your entryway the ideal middle ground in this pizza delivering scenario.  
Dog lovers, you're not off the hook here either. Cats may make their surroundings look and smell like a hobo's spent a fortnight rolling around in beach sand and .99 Cent Store detergent, but dog owners seem to overlook the fact that their particular metaphorical transient doesn't stick to the litter box and instead seems to enjoy dropping regular dooks on the floor in front of their dining room. These collectors of canines also seem compelled to invite individuals into their homes at an equally alarming rate as most crazy cat people, which is unfortunate on multiple levels. First off, cats can't maul you. Well, they can, but if Snickers the six pound siamese sets loose on you and you lose that battle, then that's on you. Meanwhile, there's really no way to stem the inevitable bloody tide when a 97 pound rottweiler gets a full head of steam and decides to show you what the inside of your inner thigh would look like if it collided with a milk bone scented auger. Also, inexplicably, dog owners never seem to pick up the dog shit that their dachshund deposits around their domicile. I've never been invited into a living room and stumbled into a rogue cat turd that caught me by surprise. Dog owners on the other hand, they apparently like to keep souvenirs of their dog's squirrel infused feces so they can sell it at their local farmer's market as a natural remedy to a sinus infection. That's the only explanation that makes any sense anyway. Why else would dog owners just let landmines like that lay around? My last complaint about dog owners inviting us in is that dogs bark and growl, cats don't. Cats see a stranger and book it for the nearest bed frame that they can hide under. Meanwhile, dogs decide that the only option is to dole out some well timed tinnitus inducing terror. And as much as I like delivering pizzas, I would love to be able to make it to my third decade of life while still being able to hear my inner monologue. I mean, feeling like your chow shoved a sharpened pig hoof into my ear drum is awesome, but being able to hear the sweet nothings that my loved one is trying to whisper into my ear (the porn that I've almost got muted because my apartment walls are paper thin) at the end of the day is a little more enticing.
Besides the fact that companies these days seemingly don't trust customers and employees to interact without some kind of looting or light raping occurring; and despite the fact that your house may or may not smell like a Porta Potty that Major League Eating champ Tim Janus spent a week in after setting the Guinness world record for eating Sushi (141 pieces in six minutes!); there is another reason for us waving off your invite. Customers can be scary. We don't want to wander into the tool shed that you call a home that's centered in the middle of the Mojave desert to serve you under the twenty foot Jesse Ventura banner that you've got stapled to your ceiling. You sharpening your samurai sword on a whet stone while never breaking eye contact isn't going to push us over the policy breaking edge either. Hide the cutlery, stop disassembling and reassembling your assault rifle while blindfolded, and try to look like you've seen an orthodontist at least once in your lifetime. Then, and only then, will we make an exception and walk on in. I don't think this is asking for all that much. Just fire up your Scentsy candle, put the dogs outside and look like you know that a toothbrush isn't literally meant for one tooth. That's honestly all it really takes. And if I'm asking for too much, just pay us outside. That way I can avoid bleeding from the eyes because of the pack of dogs you have living in your studio apartment, and your mind can be set at ease since you won't have to worry about me nicking the decorative urn that I mistook for a Faberge egg because I was smoking hash out of my vape pen on the ride over. It's a win-win.

I do appreciate the kind gesture, though.