In the case of Katie Hill, there is the matter of the employee/employer relationship. Apparently this is also contrary to the House of Representatives code of official conduct (clause 18a):
https://ethics.house.gov/publications/code-official-conduct (It would also be against the rules in every office I've ever worked in.)
> 18. (a) A Member, Delegate, or Resident Commissioner may not engage in a sexual relationship with any employee of the House who works under the supervision of the Member, Delegate, or Resident Commissioner, or who is an employee of a committee on which the Member, Delegate, or Resident Commissioner serves. This paragraph does not apply with respect to any relationship between two people who are married to each other.
Of this, Speaker Pelosi said "[Hill made] some errors in judgment that made her continued service as a Member untenable. We must ensure a climate of integrity and dignity in the Congress, and in all workplaces."