The reason I believe why most people believe it’s a totally bad idea to have a best friend of the opposite sex is because some people use that as an excuse conduct their immoral behaviors. Yes, not everyone has self control and discipline and when such person has a best friend of the opposite gender, they see it as an opportunity or an easy ticket to get down with that person since they most likely share personal stuffs.
Asides this, there’s absolutely nothing wrong with having a best friend of the opposite gender. I personally have a best friend who’s of the opposite sex, we’ve been best friends even before I got married and we are still best friends till date and even my wife knows about/supports our friendship. As a matter of fact, such friendships (if genuine) has several benefits and advantages because there might be stuffs you wouldn’t talk about with your friend who’s of the same gender, and in such situations, you can freely express yourself without feeling uncomfortable or awkward.