“It is a part of sovereignty to transfer the penalty due to the crime of one upon another, and substitute a sufferer, with the sufferer’s own consent, in the place o a criminal, whom he had a mind to deliver from a deserved punishment.
God transferred the sins of men upon Christ, and inflicted on him a punishment for them. He summed up the debts of man, charged them upon the score of Christ, imputing to him the guilt and inflicting upon him the penalty: 'the Lord hath laid upon him the iniquity of us all;' he made them all to meet upon his back: 'He hath made him to be sin for us' (2 Cor 5:21).
He was made so by the sovereign pleasure of God; a punishment for sin, as most understand it, which could not be righteously inflicted had not sin been first righteously imputed, by the consent of Christ, and the order of the Judge of the world.
Without this act of sovereignty in God, we had forever perished: for if we could suppose Christ laying down his life for us without the pleasure and order of God, he could not have been said to have borne our punishment
It was an act of Divine sovereignty to account Him that was righteous a sinner in our stead, and to account us, who were sinners, righteous upon the merit of his death."
Stephen Charnock, The Existence & Attributes of God, 1:424-25.