21:27and nothing unclean and no one who practices abomination and lying, shall ever come into it but only those whose names are written in the Lamb's book of life.

and nothing UNCLEAN

Other translations use the word 'defiled' instead of UNCLEAN; so let's look at what 'defiles' a man:

his words
Matthew 15:1-11-18-20
with whom he worships or what he worships Acts 21:27-28-30
the eternal cleansing of Christ's blood is denied
Hebrews 9:11-13-14

and no one who practices abomination and lying, shall EVER COME INTO IT

Out of the list of persons who are in the lake that burns with fire and brimstone (verse 8), the abominable and liars are singled out here. This shows these two kinds of sin are especially abhorrent to God. The abominable show by their deeds that they don't believe in Jesus Christ (Titus 1:15-16). The liars because they are the opposite of THE TRUTH (one of the names of Jesus Christ - John 14:1-6-11) can't come anywhere near to 'IT', the new Jerusalem (THE CITY). THE TRUTH and His wife live in the new Jerusalem (verse 2).

but only THOSE WHOSE NAMES ARE WRITTEN in the Lamb's BOOK OF LIFE.

It is appropriate here to restate our understanding about the BOOK OF LIFE. Everyone's name is written into the BOOK OF LIFE at the conception of that unique life. As that life is lived, sin is committed by that life (Romans 3:21-23-31). The Lamb then erases that life's name from the BOOK OF LIFE (Revelation 3:5). The life, when it accepts Jesus Christ as Lord and Savior and holds onto that commitment (overcomes - verse 7), has that life's name restored to the BOOK OF LIFE by the Lamb. It is our choice to be in the BOOK OF LIFE; it is Christ's choice of your eternal residency, all because of where your NAME is written. If your name is NOT in the BOOK OF LIFE, you are doomed (Revelation 20:15). If your name is in the BOOK OF LIFE, you are a resident (inheritor - verse 7) of the new Jerusalem, THE CITY.