Thank you for your question!
As the video below explains: “The purpose of discipline is to live fully.” That is what the “Code of conduct” means to me. You have the boundaries limited but within those boundaries you could explore. Discipline does not mean rigidity. It means to “reform” the self by following guidelines. I mention the word “reform,” because as you mentioned about the youth, if we do whatever “we feel” like, it is not really within the limits of “whatever we want,” but whatever we have learned that we want. For example, we know that water is good for you, but on any given day most westerners would rather have a glass of “Coke” than water. We have acquired a taste for carbonated water with sugar and caffeine, we need to “reform” the self; thus; discipline. Some people take up discipline for a weekend, some for their entire life, but there must be understanding as to why we are doing what we have decided to do, for otherwise; there will be repression.
Just like love goes together with detachment; true discipline goes together with flexibility.