Batman is the master of ALL guns, and he is the number one shot in the world. He can hit a target a mile away with ANY random gun, and he can even disassemble any known gun and reassemble it, holding the world record time. He knows guns inside and out...therefore he's superior to his enemies' own knowledge.
Not only does he understand the enemy's weapon better than the enemy (embarrassing) and can use the enemy's weapon better than they can as his motive, but the other motive is simply that Batman is a master of war and knows war and all of it's tools inside and out. He knows the weight of a loaded gun, the weight of a fresh sword and a sword that has already been used. So the other motive of Batman's mastery of the gun is simply that as the greatest master of war Batman actually has mastered every weapon known to man. A canon, a knife, a car, a hammer, a nail, a dart, a gun, etc.
Now, just because he's good at it doesn't mean he's interested in it. Mainly speaking, Batman doesn't LIKE GUNS. He does not use them because he is just way better than that. Take away a man's gun and what do you have? Well, you COULD have a lazy fat ass or a scrawny criminal coward. But Batman is a TRUE warrior and does not rely on guns, Period. He is just that good. If you met someone like that you'd be seriously intimidated. Why he doesn't like guns is beyond the Crime Alley issue, it is simply a coward's weapon, not a warrior's weapon. Batman finds them to be "LOUD AND CLUMSY THINGS!!" (quote from Frank Millers DKR), there is very little honor and strength for using a gun, almost like video games or golf.
So those are the two issues that directly answer the question; he does not use guns personally because he doesn't like them. 1. He doesn't like them because as a warrior he finds them to be of poor character, or at least a LESSER warrior. 2. He also doesn't like guns because he knows the evil they do from Crime Alley. But a third tangent reason is he doesn't NEED guns, he's just that skilled and that fast, and that elusive in the shadows. For that matter he hardly uses weapons! If anything he uses items and inventions from his wizardry at science that would make Mr. Fantastic look pale. Batman doesn't use body armor (Bale crap), he doesn't use much weapons (occasional batarang of course), he doesn't rely on a vibranium shield or adamantium knives. For over 60 years, he has mainly operated as a MANIMAL of extraordinary skill and near superhuman prowess. Guns are like training wheels from his vantage point.
Even though he never uses it, he still trains and practices with them, just to keep it fresh in his memory and never forgetting how his enemies feel, he's inside their head.
Now, he may use PROJECTILE DEVICES like laser guns or ion cannons, etc when he's dealing with a cosmic force but these sort of devices he invents or builds are not actually used destructively. With a normal gun on a human, it'll either maim or kill, pure and simple. But firing his blast cannon on Superman or Darkseid will perhaps render them unconscious or immobilize them, so it's nowhere near the same. Plus, he'd only resort to these projectile devices if he absolutely had no choice and especially if he had to save the Earth or for some wild crisis event.
So, technically he MAY resort to a "gun" of some kind scientifically, but he doesn't use guns in the traditional sense: bullets shooting flesh.
Also, Detectives don't use guns (as someone wrote above) since Sherlock Holmes didn't really use any guns (for the most part). And being a detective is the same as a doctor or an archeologist, or even a philosopher. Detective does not mean crime fighter; the English word detective means one who DETECTS the truth, by working with various clues and evidence to conclude with impeccable logic. So just because he's a detective (as a doctor is a detective, he doesn't use the word clue he uses the word symptom) does not mean he has to carry a gun. But more to the point, the very first rendition of Batman in the Bob Kane comics he not only wielded a firearm but he also murdered people in cold blood.
When I say murdered, I don't just mean shoot with a gun, I mean snap a neck w/his bare hands, hang someone like an actual hanging, stab with a stake, push to their doom, etc. He literally murdered men, so obviously that was the rough draft. His gun carrying and murdering days were actually less than one year!! That first year was basically the first draft, so the 65 years later had NO guns and NO murdering because Superman flies. "Superman flies you say??" I'm referring to the original Superman being a character who COULD NOT FLY. He had strength and invulnerability but he couldn't fly at all. This of course, was less than a year with the first comics so obviously a rough draft by the creators of Supes Jerry Siegel and Joe Shuster.
So if we're going to say Batman uses a gun and murders then we would equally be saying Superman doesn't fly. And that's as true as Batman using guns would be. For 60-70 years of published history after the early, clumsy, rough drafts, Superman and Batman have specific traits: They don't kill, they don't use guns, and they are the best of friends (save for a few deviant comics that make less than 1% of not being friendly).
One more trivial fact: The only reason Batman, in those very few comics, had used a gun was because Batman was originally a RIPOFF OF THE SHADOW. The Shadow was a millionaire Playboy Philanthropist by day who masked himself as a vigilante that operated by night. Sound familiar? The Shadow also struck fear into the hearts of man. Sound even more familiar? The Shadow was also a good scientist, sound like a certain Batman? The Shadow was also a great detective, had various vehicles and gadgets, and most importantly he was thought to be supernatural and had spooked the entire underworld. And of course he murdered people in cold blood with two guns. So Bob Kane was basically making his version of The Shadow and that's why Batman had originally used guns for a brief first year, he was basically just a Shadow wannabe.
Now he's moved out of the Shadow's shadow and become his own character.