It's nominally the law in my state too, but apparently it's fine to weed out the "non-performers" i.e. whoever you want. Public schools then have to take on the extra burden of the "undesirables".
In my county my understanding is that public school teachers are de facto not allowed to give failing grades if the student turned in literally anything. Like just put your name at the top and you will get passed. Charter schools have no such rule, so that is at least one way 'undesirables' are weeded out. I'm not sure the public school policy of passing out passing grades for free is providing a better education though.
How do you know that? I toured the local vocational high school when I was in seventh grade and, at least from my naive point if view it seemed legit, with students spending something like a third of their time studying HVAC or whatever.
Conversely, there's some charter schools specifically for kids with special needs. There's one in my city specifically for autistic kids.