In some schools gates are not locked during the day, but in other schools, gates are closed all the day. This topic has two points of view. There are arguments both for and against it.
On the one hand, sometimes in the same school there is compulsory and non-compulsory education, so there are students that can go out, and some students that must not go out. That is why it is difficult to check all the students and groups that can go out. Besides, many students would use that for not attending lessons that they do not like. In addition, most of the students are under-age.
On the other hand, students who study non-compulsory education have the right to go out in some cases, e.g. when a teacher does not come. In these cases students should have a card with which they will be allowed to leave school, if they are over eighteen
To sump up, I believe that the direction of the schools and the students should come to an agreement and make the situation better for both. People should always talk and solve their differences.