Bail money isn't used to keep people in jail. It is returned to you after the trail. The only time the government keeps the ball money, is if the person fails to show up in court.
The problem is, the average person doesn't have a lot of assets. Most people can't afford the ball, and many can't even give something to a bondsmen.
What if the other proposition is true? Is it ok to infringe on fundamental liberties for utilitarian reasons? If so, would you condone the chinese social points system, which follows this logic further?
No not ever, under any circumstances, even suggesting to someone you might do something like this to them could land you in jail for a long time (private persons, companies)
Yes, with essentially no limitations (government).
Which is why they use long-term incarceration (months, sometimes up to 2 years) to make it easier for them to schedule things.
Please don't think that the justice/jail system is the only example of this. Look into the powers the IRS has, other financial regulators have, or youth services, or mental health, or ...