Catholics  had been were taught that living morally was fulfilled by obeying the law, either the 10 Commandments--divine law or the commandments of the Church---ecclesial laws].  Thomist theology included the 'natural laws' that flowed from observation of the created order,  expressing the moral teaching of the Church on sex, contraception, homosexuality, and social justice.   Breaking that law made the action sinful, and the offender liable to a whole slew of punishments [which the Church drew from the Bible or from Natural Law], seen as appropriate punishments to curb bad behavior.
Catholic theology has moved from this legal model of understanding  moral life and sin.  The 'Crime and Punishment' view is deficient in many ways.  The demands of being a faithful follower of Jesus, living according to the vision and values of the gospel, challenge us in ways that can never be adequately prescribed by law.  The Bible is a record of God's graciousness to us, not a collection of do/don'ts.