Again this is not teaching salvation by works. The verse does not say that obedience is the means by which they have a right to the tree of life.
To enter in through these gates is essential for there is no other way to live. No one can force their way into this city. Its doors are impenetrable. Only those who do his commandments, whose hearts have been circumcised and who obey him willingly, have the right to enter this city. How the saints will rejoice in God’s strong government of heaven. On earth, we are most distressed when faced with wickedness, at the failure of earthly powers to enforce a proper punishment on the wicked. In heaven there will be no secret getting away with evil, no underworld. God will rigorously enforce this exclusion.
The righteous will be truly blessed, as Durham comments, just because the wicked are now shut away from them. They no longer have to put up with their language, their thoughts and attitudes, their pride and vanity, their mockery of all that is good. They can never come into God’s holy realm, for all such corruption is barred forever.
The wicked insist that they can be decent people without believing in God, that righteousness is possible without godliness. Such is not the case. When men are divided into those who worship God in truth and those who do not, they are at the same time divided into those who practise righteousness and those who break every commandment that God has given. Man cannot generate his own righteousness or set himself free from the bondage of sin. He cannot resist the steadily encroaching advance of sin’s corrupting influence.