It is right for them to be punished {God to punish them} because it is not those who merely know God’s laws whom he considers to be righteous. On the contrary, it is only those who continually have obeyed all ◄of God’s laws/of the laws that God gave to Moses► ◄whom God will consider righteous/whose record of sins God will erase►.