The below was shared in Jesus is saviour site and explains God compares our works to a perfect standard no sin like Jesus because He is holy and can not allow those with sin that they choose by rejecting Him not to be able to wash it so one has to trust in Jesus to be justified for God sees one trust in himself as sin that makes one not worthy to be saved. God opens the book of works to show everyone that they do not meet His standards to be perfect like Jesus and if they trusted in Jesus to justify them to make them righteous they are in book of life.
By saying good it just means people who have done some good things but all have also done wrong against God so it is not acceptable as Jesus said no one is good but one God as He has no sin who He is without sin as whoever does not see that they need Christ and accept Him sin so are not good.
https://www.beliefnet.com/faiths/christianity/6-reasons-good-people-go-to-hell.aspz