Keep the nails trimmed. You can also get a product that fits over the nails, but I have not tried this myself. I think it's called soft nails or something like that. I do not believe in punishment for any animal. They are animals, after all, and why punish them for doing things that come naturally?
Before I became a positive reinforcement trainer I too tried to spray my cat with a spray bottle to teach her not to get up on the kitchen counter. It didn't work. She got right back up. I even threw a whole glass of water on - it didn't work She got right back up. There are much better ways to train animals - through positive reinforcement training, environmental management and by teaching them what to do instead!
If spritzing the cat with water really worked, we wouldn't have to keep doing it, would we? Why not teach the cat what to do rather than what not to do? Then you don't have to be around to catch the cat in the act!