It is usually the parents that are penalized, but that's still pretty devastating to the kids. As for what kind of fucked up system does that, I was surprised to learn that it's something that some progressives have been pushing for[0][1], so I gather that it's a bipartisan thing. But it's fortunately fairly rare for someone to actually be jailed. In my personal experience, it was the threat of jail time that dramatically escalated the stress of the situation.
[0] https://www.npr.org/sections/codeswitch/2020/10/17/924766186... [1] https://www.huffpost.com/entry/kamala-harris-truancy-arrests...