The relevant rules are Wild Shape on pages 66 - 67:
You automatically revert if you fall unconscious, drop to 0 hit points, or die.
...
If you revert as a result of dropping to 0 hit points, any excess damage carries over to your normal form. For example, if you take 10 damage in animal form and have only 1 hit point left, you revert and take 9 damage. As long as the excess damage doesn't reduce your normal form to 0 hit points, you aren't knocked unconscious.
The other relevant bits are on 197:
When damage reduces you to 0 hit points, and there is damage remaining, you die if the remaining damage equals or exceeds your hit point maximum.
...
If she takes 18 damage from an attack, she is reduced to 0 hit points, but 12 damage remains. Because the remaining damage equals her hit point maximum, the cleric dies.
There are two ways to interpret the instant death rules:
Instant death is fundamentally, a single, atomic, operation. You apply the damage, and then under certain circumstances the target dies. Any sequencing in the description is purely to help understand the process.
Instant death is a series of steps. "Remains" implies a two phase process: apply the damage, and then check what's left. Nothing "remains" unless it is "remaining after" something else. The example is also done in very distinct steps: The cleric takes damage, is reduced to 0 hit points, then the remaining damage is checked, then the cleric dies.
If you subscribe to the first interpretation, then a spider-druid dies when they take 2 points of damage. They take the damage, it is instantly fatal, and they revert form. There is an explicit special case to prevent unconsciousness, but there isn't one to prevent death. The druid is dead.
If you subscribe to the second, then the spider-druid can take a normal amount of damage before dying. He reaches zero, reverts to druid, instant death is checked against his druid hit points, and the special-case against unconsciousness kicks in to keep him on his feet.
There is ultimately no way to resolve the atomicity of the instant death process, short of "Word of God" from a developer.
For my table, I like Druids to use their abilities as something other than a combat cooldown. But if turning into a sparrow to serenade the innkeeper's daughter means you instantly die when you fail the perception check to spot her cat Boots... Well, you aren't going to have many druids turning into things other than tigers or bears.
Therefore, I must rule for interpretation two. Because it's the only one that supports my playstyle. Your table may vary.
One final bit of food for thought:
The 4th-level spell Polymorph uses the same mechanics as the Druid's wildshape ability. So if you rule that instant-death is very fatal for shapeshifters, hope your players never realize that they can just start turning the bad guys into box turtles and stepping on them.
The item provides:
Objects in the area that aren’t being worn or carried take this damage and are pushed automatically.
Your small cave's walls get pushed away to accommodate the fortress.
As for generalizing, you can't: at least not from an item that has a specific rule. Generally, generalizing (heh!) would need a general premise to start from and I don't believe that there is one - these types of items are either specific about what happens or leave it unsaid and therefore up to the DM.
Best Answer
Unfortunately, there are no rules for this circumstance, so if our itsy-bitsy-spider-druid runs out of Wild Shape while trying to climb up a downspout, we have to come up with a ruling, and there are three routes here:
The generous route is to let the druid stay shaped until they exit the downspout (or other space that can't fit their humanoid form at all), as the unshaping fails completely. If they are 0 HP while shaped in this case, then they stay at 0 HP, shaped, but unconscious, and have to make death saves just like any other non-stabilized unconscious PC.
The stringent route is to simply eject the druid from the too-small space; this smacks of video-game physics, but skews the balance away from the druid in that he can't be an itsy-bitsy-spider-druid hiding in a downspout for months or years. If ejecting him from the space is impossible (say, if someone sealed him into a small box while in itsy-bitsy-spider-form and FedEx'ed him), then you either choose a different route, or rule that ejecting the druid either passes through or destroys any obstacles that prevent ejection from the space.
The possibly-painful route is that the druid tries to unshape, and starts to enter human form in a space too small to contain a human, so he takes crush/constriction damage (and so does the object) until either the druid dies a horrible death (the continuous nature of this damage would make it impossible for him to make his death saves), or the object that was trying to contain the unshaping druid is destroyed, leaving a fuming druid amid a pile of shredded cardboard, a ripped downspout, or what-have-you. This would be analogous to the drowning rules, as it'd be incumbent on the player to avoid putting their character into such perilous situations, and considered only a fair consequence that the druid might die for screwing up that badly.
Of course, if the druid has another use of Wild Shape at hand, they can avoid all this hassle by burning that use of Wild Shape to avoid unshaping at all for the time being.