Why should high school be mandatory then if it's not good for all students?
Because having an educated populace is good for society, and you can't know that high school is a poor fit for a student until they start taking classes. If you went off my middle school grades alone, you would surmise that I wasn't a student 'fit for high school'.
By the way, pushing all students into military school is a terrible idea. Military academies are suited to turn people into high-level military officers. For everyone else, there's no real benefit, and there's certainly drawbacks as well. For instance, the whole point of military school, apart from improving physical endurance, is to retrain people into machines that will follow orders without question and ignore issues of self-preservation and safety in order to serve a cause. This is a good thing for someone who's preparing to be shipped overseas to fight a war, but for everyone else, it's a terrible character trait.