In Siman (section) Kuf Samech (the letters kuf and samech) 160, Shulchan Aruch rules that water that is extra salty, disgusting, bitter, or contaminated—water that would not be offered to an animal to drink, and that a dog would not lap up—is prohibited for Netilat Yadayim (washing of the hands). This is why, if a person is at the beach with a sandwich and wants to eat it, they cannot go over to the ocean, take a cup, and gather very salty water from the ocean to use for Netilat Yadayim. Once they draw it out, that is called Mayim Meluchim, extra salty water. It would not be drinkable for a dog and therefore could not be used for Netilat Yadayim. Likewise, if a person was sitting around the pool and wanted to use chlorinated water for Netilat Yadayim, that would be Asur. One may not do that.
This is why a person should be careful. Sometimes people have dirty hands and are going to do Netilat Yadayim for bread. They think, “You know what? I’ll kill two birds with one stone. I’ll pump a few spritzes of soap into my Netilat Yadayim cup; it’ll lather up a little bit, and I’ll do Netilat Yadayim with the soapy water. It’s even better: it’ll clean my hands and it’ll also do Netilat Yadayim.” This is wrong because once the water has soap in it and is lathered up and contaminated, it is not fit for an animal to drink and cannot be used for Netilat Yadayim. One would first have to wash their hands with soap and water and then do Netilat Yadayim with clean water that would be drinkable.
A solution, if one is at the beach and wants to use Netilat Yadayim, is to dip their hands into the ocean, which is a mikveh (ritual bath), instead of drawing the water out. Mikveh water does not have to meet this din (law) of being clear and 100% drinkable by animals. It is considered a mikveh, so one could actually dip their hands into the ocean, and that would constitute cleanliness; then one would not have to go ahead and do Netilat Yadayim. If one did do this, they would still make a Beracha (blessing) beforehand, al Netilat Yadayim (on the washing of the hands). The Beracha stays the same, since this is the way the Chachamim (sages) instituted it. Shabbat Shalom.

