Setting up SR against a Shell Smashing Cloyster was a fairly extreme example. A real one, that's happened twice in under 30 battles, but an extreme one. The point I should be trying to illustrate here is that any turn that you spend setting up Stealth Rock is a turn that the opponent is going to take to -freely- gain advantage in some way. Whether that advantage be boosting up their stats, inflicting a status on your SR'er, performing clerical duties, eating a chunk out of your health, or even just switching into a more suitable 'mon. Assuming you're able to set it up when the opponent has all 6 of their 'mons alive, SR can be expected to eat away at least 12% of a team's total health, and even more if the opponent heavily relies on switching pokemon and/or uses a Rock-weak team composition. I could mention the likes of Rapid Spin and Defog as well, but the main reason for their popularity is specifically to remove Stealth Rock (and to a lesser extent, Sticky Web), so it's not entirely fair to credit that as a factor here.
And since I'm discounting spinning mechanics, then yes, the opponent's team will all be hit by them. They will all individually take somewhere between 3% and 50% damage each time they switch in, type depending. This amount of damage ranges from insignificant to crippling, and can very well affect the decision to switch a specific 'mon in or out. However, there are two extremes to this. Just as the mere presence of Stealth Rock can completely ruin a Charizard switch in, it completely fails to faze a Tyranitar switch in. Even though it can knock a Pokemon down from 2HKO range to OHKO range, that range is entirely dependent on which Pokemon are out at the time. If your current Pokemon can't capitalize on a potentially advantageous switch-in of an opponent, then that damage (no matter how significant) loses importance. Especially when, in retrospect, you might have had the opportunity to properly cripple/ko that specific Pokemon beforehand.
Stealth Rock is a player's way of trading off a chunk of immediate advantage for a slow return stream of advantage throughout the game. The opponent, unless they don't know what they are doing, is going to profit in some manner during that turn in which you Stealth Rock. But, as you said, the constant pressure that it applies can be worthwhile. It's just a matter of how well the opponent is able to capitalize on that turn. If they waste that turn to hit your Ferrothorn (example) with a Close Combat, then you're going to get almost immediate results back. If they use that turn to set up a Sticky Web, then you're going to have a harder time capitalizing on that potential 50% chunk you would take out of their Charizard when it now outspeeds the majority of your team. And if that Ferrothorn decides against hitting Cloyster with a Gyro Ball (and softening it up for a hypothetical Scizor later on), and allows that Cloyster to set up Shell Smash completely unhindered... well, you know.
Also, I don't want to jump on you for it, but you know that Stealth Rock doesn't drain health 'every turn', but on 'every switch'. I could have just ignored that, but it ties into another point I want to make: repeatedly switching is generally disadvantageous. Unless it's through Volt Switch / U-Turn / Parting Shot / Baton Pass, a switch gives your opponent a free turn to do whatever they want. You can capitalize on that by, say, switching a Sap Sipper into a predicted Grass attack or whatnot. But generally, a switch should only be used to mitigate an immediate threat, or to take advantage of the current field situation to set up. Stealth Rock serves to slightly punish that mentality, specifically so for frailer 'mons that were close to being OHKO'd in the first place. But you've heard it plenty of times by now: Bulky Priority Meta. Even if you personally view it differently, many people are seeing it that way. With so many 'mons getting access to blisteringly fast attacks, and so many other 'mons standing strong after several high powered attacks, Stealth Rock isn't as frightening as it used to be. Even if a Talonflame lost half of its HP switching in, it can still fire off a Priority Brave Bird or two. A Goodra isn't going to mind losing 12.5% of its HP when it could already survive multiple (Special) attacks from the get-go.
I actually somewhat figured that the use of a non-standard move (in this case, String Shot) would be used as a comparison in a reply. Yes, String Shot isn't too terrible (especially since it's buffed!), but your scenario involves expending an entire team slot on a sashed Caterpie. I know, people like the concept of 'Suicide Leads', whose sole purpose is to fire off Stealth Rocks, survive a hit, and die within a turn afterward. And with Stealth Rock, you get the option (an option, not -the- option) to permanently sacrifice a team slot in order to remove some potential effectiveness from the enemy's entire team. However, String Shot actually has a benefit over Stealth Rock: It can mitigate an immediate threat. If you've given up on your brave Caterpie, and allow it to use String Shot as its final move, it is actively affecting the opposing Latios in a direct fashion. You can then send in your Cloyster to avenge it, with the knowledge that your Icicle Spear now outspeeds and OHKOs that Latios. Using that one move can change the immediate pace of the game. The same can be said of just about any move in the game, in the right condition. It can not be said of Stealth Rock. It doesn't leave your field any stronger, nor your opponent's any weaker.
It's better to treat Stealth Rock like a weather-inducing move. It doesn't confer an immediate effect (ignoring the fact that some weathers can hypothetically be used to halve Water/Fire damage, boost Sp.Def, or kill a weakened mon at the end of the turn). However, if your team can take advantage of it, and the opponent's team is weak to the strategy surrounding it, then you can capitalize on it. Using a Prankster Copycat--> Roar Riolu with Rocks out against a Mono-Ice team that's somehow also fond of Volt Switch and Baton Pass would be an extreme example of this strategy working in your favor. Not having a single Phazing move while the opponent's team is half Steel types and the only Pokemon weak to SR has access to stat-boosting moves and Priority attacks on top of a powerful offensive spread would be a slightly less extreme example of this strategy not entirely working in your favor. And I've been mentioning the general case for a long while now. Those Sneaky Pebbles can indeed do damage, but it doesn't mean that you'll always be able to capitalize on it, unless you specifically build a team around doing so.
I admit to having a Stealth Rock user on my team. Specifically, it's on a Trickscarf Smeargle. However, I've only used SR twice with it, and have never once felt the need to prioritize using it. I've found that a big part of team building these days is to turn every team member into a threat for as many Pokemon as possible. To make the best attempt at removing 'safe switch ins'. To punish any Pokemon switching in, regardless of whether or not it was a 'counter' to it. Flying defiantly against this line of logic are Entry Hazards, which welcome all manner of threats with open arms, but attempt to discourage any -further- threats after that initial one.
I understand that Stealth Rock is a powerful move, and when used early and in conjunction with plays that 'force' an opponent to switch, it can have a devastating effect on a team. However, it's not a move that absolutely must be used in order to win. It alone doesn't solidify a victory any more than any other move that you would reasonably place on a Pokemon. I've displayed several ways that allowing an opponent a single turn of absolute freedom can turn your situation into a dire one, and I've explained that even if you can set up SR 'freely', it doesn't necessarily make the game any easier for you.