It is believed that charity toward the neighbor consists in giving to the poor, in helping the needy, and in doing good to everyone without exception. Nevertheless genuine charity consists in acting prudently, and to the end that good may come thereby. He who helps any poor or needy rogue, does evil to his neighbor through him, for by the help which he affords he confirms him in evil, and supplies him with the means of doing evil to others. It is otherwise with him who gives assistance to the good.
But charity toward the neighbor extends much more widely than to the poor and needy. Charity toward the neighbor consists in doing right in every work, and one’s duty in every office. If a judge does what is just for the sake of justice, he exercises charity toward the neighbor; if he punishes the guilty and acquits the guiltless, he exercises charity toward the neighbor, for he thus consults the welfare of his fellow-citizen, of his country, and also of the Lord’s kingdom. By doing what is just for the sake of justice he consults the welfare of the Lord’s kingdom; by acquitting the guiltless, he consults that of his fellow-citizen; and by punishing the guilty, that of his country.
The priest who teaches truth, and leads to good, for the sake of truth and good, exercises charity; but he who does such things for the sake of himself and the world does not exercise charity, because he does not love his neighbor, but himself.
The case is the same in all other instances, whether men be in any employment or not; as with children toward their parents, and with parents toward their children; with servants toward their masters, and with masters toward their servants; with subjects toward their king, and with the king toward his subjects. In these cases he who does his duty from a sense of duty, and what is just from a sense of justice, exercises charity.
from Arcana Coelestia, Sections 8120-8122