Doesn't Buddhism say you can never day and you'll re-emerge in somebody else's body?
I guess it depends on your personal outlook.
c.f. notions of transcending for other possible interpretations.
I think rather than punishment, it's more like a lesson. And dukkha is often mistranslated as "suffering", but in reality it's closer to dissatisfaction or unhappiness (sadness) rather than suffering.
I always wonder if he would have advocated for suicide if only he didn't believe in rebirth.