Moreover by them is thy servant warned: and in keeping of them there is great reward. (KJV)
Obviously we cannot fully keep GOD's law because we're imperfect. GOD accepts our attempt even though we don't even come close to keeping the law. GOD warns the wicked to stop being wicked and the righteous to continue to be righteous. There is "great reward": "Religion makes our comforts sweet, and our crosses easy, life truly valuable, and death itself truly desirable." -Matthew Henry
The "religion" he speaks of does not have the same meaning that it does today. When he said religion, he meant Christianity: believing in Christ Jesus, the SON of GOD, to save us from Hell fire.