How would you define sexual immorality in Torah or Tanakh, sense?
Is it about motive or is it about what actually takes place?
Your question is general and vauge. However, in general, sexual immorality for example, having a relationship with a married woman, the act is forbidden, and the motive will not matter, the act is forbidden in all instances. If you have a specific instance or situation that you would lke to dicuss we can do so.