The rules are usally posted in the class or the teacher tells the student what they expect. If the student disagrees or is falsely accused, then they should respectfully tell the teacher why they are falsely accused. This probilly won't happen often anyway. The student will take charge of fixing false accusations and this will help the students become successful adults. This will teach responsibility.
Also, students sometimes break the rules because they think they will just get a warning. Eliminating warnings will reduce the amount of detentions given and will waste less paper and save trees. By eliminating warnings, we can slow global climate change and reduce our pollution. This will reduce health issues. This will make all of the doctors lose their jobs and will give them free time to open cat rescue centers. This will make the world a better place because cats make everything better. Then the cat population will take over the world, spreading happiness and love. This will end depression and will improve the quality of life for everyone. Cats will run the government and would change the currency to litter-nuggets. The only available job would be litter box scooping. This would decrease Earth's hygiene because the poop would be used as money. This would cause doctors to be needed to treat the sick cats. Much of the cat population would die, bringing sadness and depression back to Earth. The cat population would return to current Earth standards. The government rule would return to the hands of humans who would bring back pollution and disease. The government will sell the cure to the problems they create just so they can make money.
To conclude, students should not be given warnings for various reasons.