Genesis 12:17
And the LORD plagued Pharaoh and his house… The consequences of Pharaoh’s actions affected his entire house, even though he was unaware of any wrongdoing. (Notice that God did not plague Pharaoh because of his polygamy, though he undoubtedly had many wives already. God only punished him for adultery.) It is often difficult to predict before-hand what consequences an action might have, so it is crucial that our every thought and action be subjected to the highest moral standards. Men must keep their thoughts and their eyes from likely error, assume that all women are unavailable until a betrothal commitment has been made or permission to court has been granted.
Update: “All potential error” was way too strong. You’d have to blind and maim yourself.
Check out A Commentary on Marriage in the Bible!