Our desires are sinful, our heart is rebellious, but we are smart enough to suppress it. If that's what we are doing, we are not obeying the greatest commandment. In a less obvious but similar approach, some people are afraid to disobey because they'll be plagued by feelings of guilt. They don't like to feel guilty, so they avoid the unpleasant feelings by toeing the line. This obedience is also done for self-benefit.
Some people do the right thing because they think they'll be blessed for it.
They are keeping the law because they think that God is paying them to do it. It's a mercenary motive, still essentially selfish, and their relationship is like that of a servant instead of a member of the family. It's better than not obeying at all, but it is less than God requires. All such motives are partially selfish, and God wants us to do better. He demands perfection in our motives as well as in our actions.