The poll seems to assume this is a simple question that can have a simple answer.
The shotgun is nice to have at night, for close-range situations. A simple bead-sight shotgun is a very powerful, quite ambidextrous tool. While this describes many defensive situations, it does not describe all.
I have cleared houses and buildings, in the police context, too many times to even estimate, in over 27 years of wearing a big-city PD badge, mostly on night shift. While private citizens should not make a habit of clearing buildings alone, those who have family members in other rooms may well be compelled to do so. A light-weight carbine, with a minimal-legal barrel length, is much handier indoors and in other confined spaces. (I want a powerful handgun with me, regardless.)
I am quite OK with either carbine or shotgun, most of the time, in the kinds of defensive scenarios typical in my region. Because my badge means I should observe certain rules even off the clock, I am more likely to deploy a shotgun than a rifle, 24/7, at this point in my life. When I retire, life will be simpler with just carbines around, so I may or may not relegate the shotguns to the safe at that time.
I have typed MUCH lengthier responses to similar questions in the past.