Is it a sin to flog yourself?
"So husbands ought to love their own wives as their own bodies; he who loves his wife loves himself. For no one ever hated his own flesh, but nourishes and cherishes it, just as the Lord does the church" (Ephesians 5:28-29).
Paul's advice to husbands is based on a fundamental principle that people don't get involved in self-harm.
People who hurt themselves typically do so because they feel they need to punish themselves. More often than not, the feeling that they need to be punished is irrational; that is, they are looking at the situation wrong. Often bad things are happening to them, for which they are not the cause, but someone is pressuring them to think that they are responsible. It becomes a trap where they think they are bad, but since it isn't really their fault, they can't correct it. Hence, the feeling that they need to punish themselves. It is a way to cope with what feels like overwhelming problems.
The problem is that self-harm doesn't solve anything. It gives the illusion that you are doing something, but nothing really changes; instead, you have yet another thing that you feel bad about. Thus, in the long run you feel worse.