Incarceration is supposed to protect the upcoming trial, from the accused fleeing, tampering with evidence or witnesses.
It is not a punitive measure. Innocent until proven guilty, etc.
So while it's fair to criticise the disparate abilities to post bail, changing the system to incarcerate more rich accused would just be compounding injustice.