The answer to your question, which you have asked is a very fundamental one, rests on the understanding of the living entity’s free will.
Because there is free will, the living entity can choose to misuse their free will.
When this choice of misuse of free will is exercised by the living entity, the Lord may sanction it.
But the punishment is also there along with the sanctioning, so that the living entity learns the lesson that misuse of free will, will not bring happiness.
If you look on the other side of the question, ‘Why is it that God does not restrict our free will so that we cannot misuse it?’, then you have a situation where love is also not voluntary but forced.
That is not love, that is something else.
For there to be real love for God, there must also be the opportunity for free will, including the misuse of free will.
[For more videos, visit – www.harekrishnatube.com]