Pure water has the chemical formula H2O. It has the properties it has, there is nothing you can do to change that.
The closest you can get with pure H2O is water / ice slush. This can form naturally when water is cooled down to 0 celsius while being agitated. It's called Frazil ice . But if left long enough it will go hard, just as old snow does.
To make goo, you need to add polymer to water. Surprisingly small amounts are required. This small 85g box of Jell-O is enough to make an entire bowl of solid dessert.
Foaming is caused by a group of chemicals called surfactants. they lower the surface tension of water and cause bubbles to be more stable. These also tend to be organic molecules (not necessarily polymers but the gooeyness also helps to stabilize the bubbles.) Common soap is made by reacting fat with caustic soda to break the fat down into fatty acids and glycerol.
Substances that create these effects are often of biological origin (nasal mucus, algal slime, etc.) These would have nutritional value, but would therefore unfortunately be colonized by bacteria, fungus and other nasties if left in the open, so you wouldn't want to consume thm
But you can get a similar effect when you mix two salt solutions, rapidly, causing a solid to precipitate instantaneously. This is the process used to make the beads of silica gel which is then dried by heating to form the hard granules of drying agent that you find in new purchases.
There are also clays which are very sticky, such as bentonite.
While I wouldn't recommend eating silica gel or bentonite, they shouldn't do you any harm and are of no nutritional value, so if they are from a very clean environment such as a lifeless planet they should be bug free.