Bail isn’t punishment. (How could it be? It applies before there’s even been a trial, much less a conviction.) It’s assurance, based on such factors as the seriousness of the charges and an assessment of flight risk, that the accused will show up for subsequent stages of the process.