It’s not necessarily punishment, e.g. leaving an abusive partner is in most cases about self-preservation, and if intended as a punishment, very ineffective at that. That said, I think a lot of people who end up at the receiving end of it do tend to try to spin it as a punishment due to self-centered thinking and in order to frame themselves as the victim.