Don't know if the punishment fits the crime in this case, but for some crimes I think flogging is a much better solution than putting a family's breadwinner in jail long enough that the kids have to be sent into the foster care system.
I would wonder if Indonesian "foster care" doesn't mean the streets to be sexually abused the rest of their lives, which will be short.