If the Kingdom of Heaven is the New Heaven on Earth what are these people in Revelation 22 doing outside the gates of the New Jerusalem? Are we to believe that there will be some people in Heaven but not able to enter the city because of practices they participated in after their salvation?
In Revelation 22, those who are outside the city mean those who are outside the city in Hell. It doesn’t mean they are sitting peering into the gates of the city, and somehow real close to it. It doesn’t say immediately outside. It just means they have no access to it.
However, at the end of Rev. 21 it speaks of how the gates will not be shut because people will enter. The kings of the nations of the Earth will access it. There will be saved people on the New Earth who are outside the city gates and will be entering the city gates and that is why they are opened. It is saved people who have come into the gates of the New Jerusalem and will depart from and go through the gates to the New Earth.
So Revelation 22 and Revelation 21 are speaking of the gates in two different ways. They are not contradictory. Revelation 22 has a more symbolic meaning. It’s speaking of the saved, those who are in the New Jerusalem (and/or have access to the New Jerusalem) where the throne of Christ is.
For more information on the subject of Heaven, see Randy Alcorn’s book Heaven.