What I don't get is why someone would need a freaking hunting, battle or whatever-rifle or shotgun when for simple defence a handgun is completely sufficient.
A shotgun isn't a rifle, hunting, battle, or otherwise. In fact, a semi-automatic riot shotgun is almost a perfect weapon for home defense.
Unlike a rifle, which fires a single very powerful bullet, a shotgun fires numerous small pellets in a conical arc in front of the weapon. The width of a shotgun's arc determines the shotgun's stopping power and likelihood of hitting a target at a given range. The wider the spray, the shorter the shotgun's ideal range. The riot shotgun goes for a fairly wide, short-range arc perfect for home defense.
The most important characteristic of the shotgun is accuracy, good and bad: good, because with the spread pattern a homeowner is more likely to hit a target just by pointing and shooting, and bad, because the spread will also almost certainly hit things the defender wasn't aiming at. A final consideration of the way shotguns are aimed is that very little training is required to become nominally proficient.
The semi-auto is just in case your first shot misses. Within your likely target ranges you're throwing a cone with a diameter somewhere between that of a coffee cup and a dinner plate. You can still miss.
When we get to penetration versus stopping power shotguns are in a class by themselves. A shotgun blast has brutally lethal stopping power but doesn't typically penetrate walls or doors, a huge advantage for home defense. A hunting rifle could well shoot through a wall and hit an innocent bystander. A 12ga shotgun blast might obliterate a wall, but it probably won't penetrate. Think of it as a spiked sledgehammer and you've got the right idea.
Funny you should ask how a rifle might be used for home defense. I happen to know the answer.
On farms they are the best choice for defending people and livestock against predators.
Against human attackers rifles are the best option for defending from cover at long range, a situation which while rare actually does come up during civil disturbances, most famously the LA Riots. In neighborhoods where property owners were armed the mob turned aside. Dug in as the defenders were, on roofs or behind vehicles and armed with rifles, the mob was completely outclassed.