Catholic social teaching makes it clear that there are two distinct but related ways of showing our love for others. The works of mercy are one way, but there should also be works of justice. We should feed the hungry (work of mercy), but we should also work to end hunger and eliminate the causes of hunger (work of justice). We should shelter the homeless but we should also strive to understand homelessness so that we can take steps to eliminate, or at least limit, homelessness. We should give alms to the poor, but we should never accept poverty as an acceptable reality; we should work to end poverty.
There is no conflict between the works of mercy and the works of justice, and indeed they go hand in hand. The great American convert, Dorothy Day, was an example of someone who worked for both mercy and justice. She opened houses for the homeless, and at the same time, she took part in demonstrations for workers' rights and against war.