It is always clear, in the book, that the entire intention of the Scholomance is to make the school as safe as possible - the builders were, after all, planning on sending their own children, grandchildren, etc. All of the dangers, then, are entirely the result of the limitations and failures in the school's design and construction.
Near the beginning of the book, El is grousing about being saved by Orion and narrates:
We’re not meant to all survive, anyway. The school has to be fed somehow.
This is discussed later in the book when another character talks about how many people Orion has saved (approximately 600) and the fact that the amount of food available in the cafeteria is not enough for everyone.
And then at the beginning of chapter thirteen:
We’d made it to our senior year, the one in two odds we’d beaten so far.
Also, from half-way through chapter one, talking about graduation:
About half the senior class—that is, half of the ones who’ve managed to survive that long—makes it.
There are three main features of the school designed to protect the students. The first is the fact that only the Graduation Hall is connected to the outside world, the rest is surrounded by the void. The second is that there is very little direct connection between the Graduation Hall and the rest of the school. Third is the cleaning cycles.
There are at least three Mortal Flame cleaning cycles specifically mentioned in the book:
- Graduation Hall just before graduation
- The main halls and stairwells of the school twice a year
- Kitchen after each meal is served (though it wasn't clear exactly how that worked)
Near the end of chapter three, the protagonist tells us:
It’s one of the few situations in which a wall of mortal flame might actually be called for: in fact that’s how the school cleans out the cafeteria and does the twice-yearly scouring of the halls.
And half-way through chapter six:
The builders knew that some mals would wriggle their way up to us, so twice a year the halls get a good scouring. A very loud warning bell goes, we all run for our dormitory cells, shut ourselves in, and barricade our doors as thoroughly as we can. Then massive cleansing walls of mortal flame get conjured up and sent running on their merry way throughout the whole building, from top to bottom, incinerating hordes of desperate fleeing mals.
And shortly after that:
If you’re wondering why they don’t also run this excellent system down in the graduation hall to clear out the mals before dumping in the seniors, the answer is they meant to, but the machinery down there has been broken since about five minutes after the school opened. No one’s going down to the graduation hall to do maintenance.
Since the system in the Graduation Hall is the only one that failed, only the survival rate of students who actually reach graduation is affected.
Near the end of chapter one, El says:
Even enclave kids were getting eaten more often than not before the school was built, and if you’re an indie kid who doesn’t get into the Scholomance, these days your odds of making it to the far side of puberty are one in twenty. One in four is plenty decent odds compared to that.
For all that I want to go home every minute of every day in here, I know perfectly well it’s actually unbelievably good luck to be here.
Half-way through chapter three:
The place is filled to capacity with kids; there are two applicants for every spot as it is
About a quarter of the way through chapter twelve:
The enclaver kids do make it out alive almost all of the time—their survival rate usually hovers around eighty percent, a substantial improvement over the forty percent chance they’ve got if they stay home.
And that's even without the end-of-year cleanup of the graduation hall.
So, while it is clear that the Scholomance is an imperfect solution to an impossible problem, it is also the best available chance of surviving to adulthood for anyone fortunate enough to get in.