the ancient world also had rules stoning those men.
No, the Israelites had such rules.
The practice was widely accepted among many peoples, and as is usually the case the rich and powerful could get away with anything even where it was against the law.