In fact the Lord tells us in Matthew that this is true. He said to the ones who had done good things that they had given him something to eat, given him something to drink, taken him in, clothed him, visited him, and come to him in prison, and then said that as much as they had done this to one of the least of his people, they had done it to him (Matthew 25:34–40). These six good deeds, understood spiritually, comprise all the kinds of neighbor.
This also shows that when we love doing what is good we are loving the Lord, because the Lord is the source of what is good, the one who is devoted to what is good, and the one who is goodness itself.
However, it is not just people as individuals who are one’s neighbor but people in the plural. That is, it is any smaller or larger community, our country, the church, the Lord’s kingdom, and above all the Lord himself. These are “our neighbor” to whom we should do good out of love.
These are also ascending levels of neighbor. A community of many is a neighbor on a higher level than one individual. On a level still higher is our country, on a level still higher is the church, and on a level still higher is the Lord’s kingdom; but on the highest level, our neighbor is the Lord. These ascending levels are like the rungs of a ladder with the Lord at the top.
A community is a neighbor to a greater extent than an individual is because it is made up of many individuals. We are to practice caring about it just the way we do with respect to individuals, namely, according to the goodness that we find in it. This means that the exercise of caring directed toward a community of honest people is totally different from caring directed toward a community of dishonest people. We love a community when we are concerned for its welfare because of our love of what is good.
Our country is our neighbor to a greater extent than our community is because it is a kind of parent. It is where we were born; it nourishes us and protects us from harm.
We should do good to our country out of love according to its needs, which focus particularly on its being sustained and on the civil life and the spiritual life of the people who live in it.
If we love our country and do what is good for it with goodwill, then in the other life we love the Lord’s kingdom because there the Lord’s kingdom is our country. Further, anyone who loves the Lord’s kingdom loves the Lord because the Lord is everything to all of his kingdom.
from New Jerusalem, Sections 90-93