Is "Students attending BYU are required to follow an honor code, which mandates behavior in line with LDS teachings such as academic honesty, adherence to dress and grooming standards, and abstinence from extramarital sex and from the consumption of drugs and alcohol." a good answer to the question "What is the basis of the behavioral code at BYU?"
yes