There are different reasons for obeying God’s laws depending upon spiritual maturity. The first level is to obey to avoid God’s wrath. Basically, to avoid discipline, much like children do with their parents. The next level is to obey because you love God and do not want to disappoint Him. Again much like children with their parents. The pinnacle is to obey because you love God and understand how God’s law is about the Father’s love for us.
This spiritual maturity is very similar to maturing children. We start out obeying out parents and authority figures to avoid discipline. After sometime, we begin to obey to avoid disappointing our parents/loved ones. Then, after we have matured enough to understand the reason for the rules, we obey because doing otherwise would cause harm to us or others.
God’s laws are to protect us. Think of the ten commandments. If we do not keep a good relationship with Our Heavenly Father, we are left unprotected (1. He is our one God 2. Go to Sunday Mass 3. Do not curse His name). If we do not keep good relationships with our brothers and sisters, we are asking for retaliation (4. Honor your parents 5. Do not kill 6. Do not commit adultery 7. Do not steal 8. Do not lie 9. Do not desire another’s spouse 10. Do not desire another’s stuff)
Keeping God’s laws keep us safe in this life, but more importantly in the next. Ultimately, God’s law is to love. We just are not smart enough to know how to love without God telling us, so He had to tell us. He gave us the Church, in order to help us. She lets us know what love is and is not, which we definitely need as times have changed quite a bit since Jesus was crucified.