I think that rule applies more to none Starfleet aliens. Seeing as how all Starfleet personnel are screened and scanned regularly. Though I was always under some assumption that like with any uniformed forces, relations between officers were generally discouraged. Though generally it would depend on the captain too since Starfleet captains have a lot of the same powers ship captains of old had. Marriage, judgement on those that disobey, the power to grant a higher rank to those that serve under them. That's actually what Starfleet always reminded me of more than anything, the old British or Spanish navies and captains going out to sea to discover the world knowing that they will face unknown cultures and pirates along the way.