Other possible meanings are 1) "because we all sin, God put all things under the control of the law, like putting them in prison, so that what he has promised to those who have faith in Christ Jesus he might give to those who believe" or 2) "because we sin, God put all things under the control of the law, like putting them in prison. He did this because what he has promised to those who have faith in Christ Jesus he wants to give to those who believe."
Paul is treating scripture as though it were a person, and he is speaking of God, who wrote scripture. Alternate translation: "God" (See: [[rc://en/ta/man/jit/figs-personification]])