Look up the 'box o truth' in google. Old retired guy did a bunch of 'tests' with standard drywall and studs. Made a box that is the equivalent of 6 standard house walls. Tested rifles, handguns, shotguns on it to see the difference between over penetration and the like.
In a home defense scenario, yes, a shotgun would be best. Thing of a dark firefight (more than likely a couple of shots at most) and you not having time to aim efficiently to acheive a proper stop to the threat with a handgun...and a rifle will go through your house, and into neighbors houses, whereas a shotgun will give you enough spread to not have to worry about shot placement as much as a handgun or a rifle. Now that is not to say that you can just rack and bang all throughout the house, but it takes some guesswork out of it. Then again, proper training on all firearms would make each gun a go to gun for each certain scenario.
Shotgun would be a primary weapon, handgun would be secondary. If you need a rifle, and more than a tube full of shot, and a mag or 2 per gun, you probably need a swat team, and need to be jumping out of a window and getting to safety.
Pumps are also simple, no nonsense rack and pull the trigger guns. Less chance of failing/misfeeding/misfiring/ejection problem. Rifles can jam, so can handguns, and that will put you down and out if your gun has a malfunction, whereas a shotgun really has less of a chance of this happening, due to less parts in the gun that can fail. Revolvers are the same in that sense.
Besides, the racking of a shotgun can be a very scary sound, or a turn on, depending on who you ask LOL