I found a number of news stories and official documents about public schools with such policies including:
The last story is about a school that threatened to call the local child protection authorities to take children into custody if parents were late, even by a short time. This was rescinded and apologized for.
None of these stories mentioned any source of authority to impose such fines, nor any parent who had legally contested such fines. Public schools do not generally have authority to fine parents unless a law or ordinance grants such authority. Usually a school would need to file a report with law enforcement, and any fine be imposed by a court. But it may well be that parents are simply paying in such cases, rather than insisting on legal authority. If a student is left unsupervised, a school would pretty clearly have the right, and in some cases the duty, to notify the police or the appropriate child protection agency. Parents might fear that resisting the fines would lead to that far more drastic response, and so not challenge any fine.
I did not include any of several news stories about similar practices in the UK, as the legal basis would be different there. But there were several such stories.
There were also several stories suggesting that such fines can be counterproductive. It seems that some parents tend to come to regard them as fees, and are perfectly willing to pay, and the fine replaces the feeling of social obligation which might have been stronger. But that is not really a matter of law.