But so does walking around in public without covering all body head to toe, indeed some countries ban women from doing so.
Simple risk aversion or trespassing on personal freedom?
It is simple risk aversion. A CEO has a whole world of people to have an affair with outside of his or her direct reports, and indeed company. Everyone has equal access to walk around in public. Surely this difference is obvious?
To use an example where we aren't talking about lawsuits, teachers are typically prohibited, by policy and / or law, from relations with their students before they graduate from highschool, even if the student is of legal age. There's both the power difference as well as an implicit duty of care where, even if the relationship is nominally consensual, the teacher is abusing their role as a trusted adult in power. Once the student graduates, there's no longer any official prohibition.
It's nothing to do with prudishness about his sex life and everything to do with his actions endangering the company.