I think you are confusing discipline with punishment.
LLoJ goes to the web to find out:
The Distinction Between God’s Punishment and God’s Discipline | Monergism
It is of first importance that we learn to draw a sharp distinction between Divine punishment and Divine chastisement: important for maintaining the honour and glory of God, and for the peace of mind of the Christian. The distinction is very simple, yet is it often lost sight of. God’s people can never by any possibility be punished for their sins, for God has already punished them at the Cross.
The Lord Jesus, our Blessed Substitute, suffered the full penalty of all our guilt, hence it is written “The blood of Jesus Christ his Son cleanseth us from all sin” (1 John 1:7). Neither the justice nor the love of God will permit Him to again exact payment of what Christ discharged to the full. The difference between punishment and chastisement lies not in the nature of the sufferings of the afflicted: it is most important to bear this in mind.
There is a threefold distinction between the two. First, the character in which God acts. In the former God acts as Judge, in the latter as Father. Sentence of punishment is the act of a judge, a penal sentence passed on those charged with guilt. Punishment can never fall upon the child of God in this judicial sense because his guilt was all transferred to Christ: “Who his own self bear our sins in his own body on the tree” (1 Pet. 2:24)
But while the believer’s sins cannot be punished, while the Christian cannot be condemned (Rom. 8:3), yet he may be chastised. The Christian occupies an entirely different position from the non-Christian: he is a member of the Family of God. The relationship which now exists between him and God is that of parent and child; and as a son he must be disciplined for wrongdoing. Folly is bound up in the hearts of all God’s children, and the rod is necessary to rebuke, to subdue, to humble.
The second distinction between Divine punishment and Divine chastisement lies in the recipients of each. The objects of the former are His enemies. The subjects of the latter are His children. As the Judge of all the earth, God will yet take vengeance on all His foes. As the Father of His family, God maintains discipline over all His children. The one is judicial, the other parental.
A third distinction is seen in The design of each: the one is retributive, the other remedial. The one flows from His anger, the other from His love. Divine punishment is never sent for the good of sinners, but for the honoring of God’s law and the vindicating of His government. But Divine chastisement is sent for the well-being of His children: “We have had fathers of our flesh which corrected us, and we gave them reverence: shall we not much rather be in subjection unto the Father of spirits, and live? For they verily for a few days chastened us after their own pleasure; but he for our profit, that we might be partakers of his holiness” (Heb. 12:9-10).
The above distinction should at once rebuke the thoughts which are so generally entertained among Christians. When the believer is smarting under the rod let him not say, God is now punishing me for my sins. That can never be. That is most dishonoring to the blood of Christ. God is correcting thee in love, not smiting in wrath. Nor should the Christian regard the chastening of the Lord as a sort of necessary evil to which he must bow as submissively as possible. No, it proceeds from God’s goodness and faithfulness, and is one of the greatest blessings for which we have to thank Him. Chastisement evidences our Divine son-ship: the father of a family does not concern himself with those on the outside: but those within he guides and disciplines to make them conform to his will. Chastisement is designed for our good, to promote our highest interests. Look beyond the rod to the All-wise hand that wields it!
The Hebrew Christians to whom this Epistle was first addressed were passing through a great fight of afflictions, and miserably were they conducting themselves. They were the little remnant out of the Jewish nation who had believed on their Messiah during the days of His public ministry, plus those Jews who had been converted under the preaching of the apostles. It is highly probable that they had expected the Messianic Kingdom would at once be set up on earth and that they would be allotted the chief places of honour in it. But the Millennium had not begun, and their own lot became increasingly bitter. They were not only hated by the Gentiles, but ostracized by their unbelieving brethren, and it became a hard matter for them to make even a bare living.
Providence held a frowning face. Many who had made a profession of Christianity had gone back to Judaism and were prospering temporally. As the afflictions of the believing Jews increased, they too were sorely tempted to turn their back upon the new Faith. Had they been wrong in embracing Christianity? Was high Heaven displeased because they had identified themselves with Jesus of Nazareth? Did not their suffering go to show that God no longer regarded them with favour?