Red stakes indicate a lateral water hazard. When you hit into a lateral hazard you have 4 options: re-hit from the previous spot, drop within 2 club lengths, no nearer the hole, of the point where your ball last crossed the hazard line, drop within 2 club lengths on the opposite side of the hazard, no nearer the hole and lastly, go back as far as you want on a line created by the hole and the point where you ball last crossed the hazard, no nearer the hole. All these actions have a 1 stroke penalty.
The last option generally does not work with a lateral hazard (imagine a river running along the side of the hole). The line from the hole to the point where you last crossed the hazard line typically is in the river or on the other side (which often you can't access). Hence the 2 club length rule.
Warning: Rules Snobs typically think
they know all the rules. I am a Rules Snob. You may want to check the Rules of Golf.