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.