The primary line of reasoning is that a buckshot shell is going to pack more force than a handgun (12-gauge #00 buckshot is 1.2k-3k ft/lbs of force spread out over 9 pellets, depending on the shell and weapon versus ~500 ft/lbs of force from a .40 handgun round), but because it's spread out over multiple pellets, it will be more easily stopped or slowed by walls or other obstructions, reducing the chances of a round penetrating a wall and harming a bystander. Additionally, a shotgun requires far less precise aiming to operate effectively, specifically because of the physics of it being a short-range weapon. Since most people don't have training in precisely aiming and firing guns in high-stress situations, a weapon that requires less precision to use effectively is going to be much more useful if you ever did find yourself in a situation that you needed to use it.
A shorter barrel would obviously be more maneuverable, but shotguns must have a minimum barrel length of 18" by law, specifically in order to prevent them from being easily concealed.
Try shooting a shotgun at the distance you would indoors and you will be surprised I think. The pellets only spread out about 1" per 3-5 ft. Shooting across a room and hitting something is still going to require some precision.
Funny story; when I was in the Army we had shortened Remington 870s used for breaching. One of my friends was trying to convince everyone that the "shorty" would be ineffective when used in a hanger because of the potential distance between target and assaulter. Another friend offered to help test the theory out by being the one behind the shotgun. It turns out that the shotgun doesn't do much when shortened but there is a strong physical reaction that occurs when someone fires one in your direction.
A shorter barrel would obviously be more maneuverable, but shotguns must have a minimum barrel length of 18" by law, specifically in order to prevent them from being easily concealed.