In these verses, it is not saying that it is not a sin to steal. It is saying a person has sympathy for someone who is so hungry that he steals to feed himself. If he is caught, the person he stole from will be happy to not prosecute him, if he will pay back what he stole 7 times.
The stealing here is not nearly as serious as the sin of adultery that we read of in the next few verses. Adultery is compared to a starving thief, who, though it may cost all he has, can make restitution and put the crime behind him permanently.
But for the adulterer, there is no restitution as there was for the thief, as he destroys his soul.