As a couple of folks pointed out, having an SPG full of water, really is a non-issue. Presumably that means that the seal holding the lens in has failed, which really isn't a big deal, in the short term. If the gauge was leaking air, that's a different story...
But to answer your question, you absolutely did the right thing. Not because there was a risk to you, but because you didn't know if there was a risk or not. It's always better to sort stuff out up top, rather than down below, when you have the luxury of time and can ascend safely.
BTW, assuming that gauge isn't some ancient old thing, it's probably quite repairable, especially if you were in fresh water. It probably needs to be flushed, dried and resealed.
I use an SPG on one of my stages that I bought in 1974... Still works like a charm~ ;-)