Yes, you are right that parents should advise and guide relationship issues. But given the range and cross cultural minefield we live in today are parents the most knowledgeable to impart adequate levels of guidance, understanding and truth to their children or will they aim to have their children mirror their own insecurities, half truths and bigotries?
Teachers have years of training, qualification, experience and mentorships to become a teacher. There is no test required to be a parent. If we value understanding, diversity and tolerance as a society I would argue both teachers and parents have a role to play in developing relationships. In a shockingly high number of cases teachers spend more time with their pupils than there parents do each day and probably have a better understanding of the student as a person than some parents.