I went to, and graduated from, the University of Virginia which has an honor code. I promised not to cheat on tests as a requirement to attend the school. If I did cheat, and was reported and I was found guilty in honor court, I would be kicked out of the school.
BYU has an honor code as well, which among other things, states students are to remain chaste. In other words, no boinking. :-) The star basketball player admitted to having sex with his girlfriend. (How did they find out?) He has been suspended from the team.
Some people are saying that's too harsh. To me, it's a punishment for breaking a rule which he knew about. BYU did the right thing and Brandon Davies has manned up by accepting it.