The APA's "Ethical Principles of Psychologists and Code of Conduct" absolutely prohibits sexual involvement between therapists and their patients, contrary to what's stated by the characters in this episode.
This episode is directed by Chad Lowe, brother of Rob Lowe.