It isn't so much that handguns are inherently inaccurate. From a bench with time to aim you can bang gongs and such at surprising ranges. The problem is they're difficult for most of us to shoot accurately in a pinch. Which is why you have so very many rounds from handguns flat-out missing close range targets in a fire fight. And why handgun vs. rifle contests end badly for the guys with the short guns.
There are also inherent problems using a firearm where long range shooting has so much "Kentucky and Tennessee" in it. A classic example is the standoff, the name escapes me at the moment, where the suspect had a surplus rifle and the police had handguns. One officer got a bead on the suspect at about 100 yards and fired off a clip, only to be shot by the suspect with a single lethal round. Later on the group from the handgun was found. A surprisingly good group, but about a foot high. With a long gun the officer could have finished the matter with a single round--esp. being a very good shot.