I think that the teaching is about not engaging in promiscuity in general, which is an act that is evident in animals (except perhaps owl monkeys). So it’s about having conscience and prudence to not engage in such action. I think the notion of friends does fit in the framework since nowadays there’s such a thing called “friends with benefits”, so…yeah.
In EA2 40, there is “若男女”, and in EA 18.1, there is “知識”, so I don’t think the message of the teaching is simply about respect, it’s about acting like how a human who possesses both conscience and prudence does.
In “Newly Identified Khotanese Fragments in the “Bodhisattva Compendium” and Their Chinese, Pāli and Sanskrit Parallels”, FAN Jingjing translated T 765’s passage as:
If these two white and pure good dharmas do not exist, the living beings in the world will get mixed up. Just like cows, goats, chickens, pigs and dogs, people will not be able to recognize father or mother, brother or sister, or rule, or preceptor, or teacher, or quasi-teacher, and so on.
Some people may translate “軌範” as “teacher”, but I agree with FAN Jingjing’s translation as “rule” (or “rule of conduct” for me) because if “軌範” referred to “teacher”, then you would expect “軌範師”, rather than “軌範”. 軌範’s usage as “rule” or “rule of conduct” is evident in T 126 where a nun is praised for her diligent effort in upholding her conduct. “親教”, on the other hand, seems to always refer to a person, whether as “親教” or “親教師”. Therefore, people can behave like animals because of not recognizing “rule” or “rule of conduct”.
In conclusion, the teaching, as I can gather from the parallel versions, need not be about just respect to and not crossing the line of family members and teachers. It’s about acting like a decent human being that can distinguish whom one can appropriately have sexual relationship with. This is certainly in line with the third precept, the teachings for laypeople where the spouse shouldn’t be unfaithful to his or her own partner (DN 31 and T 16) and to think only about him or her (MA 135), and AN 5.179 and MA 128 where the Buddha said in verses that a spouse should be content with his or her own partner.