The answer is in your bold letters.
The subject can climb and travel on vertical surfaces or even traverse ceilings as well as a spider does. The affected creature must have its hands free to climb in this manner. The subject gains a climb speed of 20 feet; furthermore, it need not make Climb checks to traverse a vertical or horizontal surface (even upside down).
The description says that it doesn't need to make Climb checks in order to traverse a vertical or horizontal surface. In that case, the check is to overcome the slippery effect of Grease spell. I would assume that it is the same as saying that a creature with walking speed needn't make any Balance checks to walk on an horizontal surface. But it still needs to make them in order to overcome obstacles. Grease is an obstacle, not a surface.
The spell calls for a Balance check, but given the specificity of the situation you describe, your GM could perfectly call for a Climb check instead. It seems reasonable.
Anaruoch: The Empire of Shade includes a 50-ft.-tall, 10-ft.-wide waterfall inside a cavern. Features of the Area describes the waterfall as follows:
Climbing beneath the waterfall requires a successful DC 35 Climb check. Flying through it requires a successful DC 20 Strength check to avoid plummeting to the pool below. (73)
Extrapolating from this, a creature that wants not to be swept away when confronted with a suddenly flooding passageway should probably allowed to make a Strength check (DC 20) if the creature has means of going against the deluge in the first place (e.g. appropriate handholds, a fly speed, an active effect like the spell spider climb, extreme weight due to the spell iron body). That is, effectively the creature has chosen to try to stay in place while the waterfall flows over the creature. Success means the creature can take its actions normally; I suggest failure means the creature's swept away (rather than having the creature plummet).
Success!
After a successful Strength check made to avoid being swept away, forward progress against this ersatz waterfall should require a climbing creature to make Climb skill checks (DC 35). (Note: While neither hydrologist nor spider-eating spelunker, I think that DC's about right considering the potential water speeds were discussing. I don't know if matters if failure means you technically fall or, instead, are technically swept away as both involve facing tons of water coming right at you! I'm guessing, but at this point traversing the horizontal seems like it should be as difficult as traversing the vertical. Comments can take up this issue, and, of course, the DM can adjust the DC as he sees fit.)
How other creatures make forward progress is up to the DM, but flying creatures likely must swim (perhaps in stormy waters), and super heavy creatures likely use their land speed (albeit maybe vastly reduced—this is, after all, pretty difficult terrain). All such creatures probably also need to hold their breath.
Failure!
After a failed Strength check, the creature's swept away. Aquatic Terrain under Flowing Water describes being swept away as follows:
Characters swept away by a river moving 60 feet per round or faster must make DC 20 Swim checks every round to avoid going under. If a character gets a check result of 5 or more over the minimum necessary, he arrests his motion by catching a rock, tree limb, or bottom snag—he is no longer being carried along by the flow of the water. Escaping the rapids by reaching the bank requires three DC 20 Swim checks in a row. Characters arrested by a rock, limb, or snag can’t escape under their own power unless they strike out into the water and attempt to swim their way clear. Other characters can rescue them as if they were trapped in quicksand (described in Marsh Terrain, above).
Emphasis mine, and which should cover equally well a rapidly flooding cavern.
Best Answer
You fall
The spider climb spell states:
Spells only do what they say and nothing in this spell description gives you the ability to remain in the air after breaking contact with the surface you are climbing on. The spell allows you to climb without using your hands, it still requires you to use your feet.
There are falling rules in both the basic rules and Xanathar's Guide to Everything which help determine what happens after you start falling. Nowhere however does it clarify what it takes to begin falling, other than a brief section on flying creatures falling. It is assumed that any creature in the air is falling, unless they have a way to remain aloft. Since spider climb doesn't grant a way to remain aloft, you fall.
By RAW you fall, however this DM would likely allow you to attempt it. I would call for a Dexterity (Acrobatics) or Strength (Athletics) check, likely with disadvantage if you were upside down. On a success you manage to get you feet back on the wall quickly enough to prevent your fall. On a failure, you don't and plummet to your doom.
The DC for this check would depend on the distance of the jump and the difficulty of the situation. You should reference the rules for jumping as a guideline and increase the DCs accordingly.