Further, all men are to be loved equally. But since you cannot do good to all, you are to pay special regard to those who, by the accidents of time, or place, or circumstance, are brought into closer connection with you. For, suppose that you had a great deal of some commodity, and felt bound to give it away to somebody who had none, and that it could not be given to more than one person; if two persons presented themselves, neither of whom had either from need or relationship a greater claim upon you than the other, you could do nothing fairer than choose by lot to which you would give what could not be given to both. Just so among men: since you cannot consult for the good of them all, you must take the matter as decided for you by a sort of lot, according as each man happens for the time being to be more closely connected with you. [emphasis added]
St. Augustine makes clear that our obedience to God with regard to the second great commandment must be fulfilled through prudence: we cannot do good to all. And God does not expect us to do so. But since the Bible doesn't tell me whether my neighbor Jim needs my charity more than my neighbor Bob, it is obvious (given the fact that we must make a choice) that how we love our neighbors is an undertaking that must be characterized by prudence. St. Thomas tells us (as the masthead up top reminds us!) that prudence is right reason applied do action, and since charity demands action, prudence must therefore inform our exercise of charity. St. Augustine gives us guidelines for exercising that prudential charity in this passage.
God neither commands nor expects from us what would require omnipotence or infinite resources to perform. We are able to obey him with his help. To say otherwise is to transform God into a sadist who puts impossible burdens on us, it seems to me. But he is not like that. He is just, so that his laws are not so difficult as to be impossible for us, and he is merciful, so that he helps us to obey. Some Protestants suppose falsely that even when we do good, we sin; this error is something that the Council of Trent rightly condemned.