No. These verses deal with hardship relating to persecution, trouble because we serve, love, and obey God. Punishment is because we disobey, God Does punish disobedience, but that is not what these verses are dealing with.
Punishment teaches sin has horrible consequences. Often, the punishment is much less severe than the
actual consequences of sin.
To make us more like Christ, and to bring peace, righteousness, into our lives, training us for heaven.