Why does God punish people? Suppose one was to believe God exists and God gave us free will, and that God punishes those people who sin.

If God gives us free will, why punish those that exercise their free will in a certain way? If God has given us free will, why does God punish those who choose to sin?

Why give us free will, if we are going to be punished for "not following God's commands and will for us"?
Firstly God's punishment is being held until the judgment due to the sacrifice and atonement of Jesus Christ. 

Secondly our free will is given to allow us to make our own choices so that God will know at the judgement bar who loved him and who did not as John 14:15 says


  "If ye love me, keep my commandments."


Just because we can choose doesn't mean there are no consequences of our choices. The commandments were given not to restrict us but to free us from sin and if followed will lead to a better and happier existence here on earth.