Both the Glock 17 and the Beretta 92/M9 are well designed, well built, reliable 9 mm pistols. Although there are exceptions, most people find them too big for carry and use them primarily for home defense and the range. The trigger and safety systems are vastly different, and may be the deciding factor.
If it matters to you, you might also consider that the Beretta is a beautiful pistol and the Glock, well, isn't. (Glockophiles, don't howl, I own and like both, but there is no comparison in aesthetics.)