By following the rules we are proving and showing our love of God to God.
If we don’t follow the rules, it is like saying that we could care less about God, even though God freely loves us, we are not loving God.
Think of a father who works all the time and spends little time with his family. He thinks he’s doing the right thing by providing for his family (which is true), but with the lack of time he spends with them he is essentially estranging himself from them. By not being with them, he isn’t able to understand their wants and desires, or what they actually need from him, part of which is his time with them.
It’s good and admirable to do good things, but we aren’t really showing our love for God by that alone. We need to spend time with Him and follow His rules which are expressed by the “rules” of the Church He established. This is good and pleasing to God, that we follow His commandments: to love God above all else, and to love our neighbors as ourselves.