What I understand this to mean is that there is greater merit in acting out of kindness than to act out of a desire to gain merit. So if one has a gift in hand which one is bringing to a temple for dana to an arahant, and one knows there will be plenty of food offered by others, then if one's heart so moves, there is greater merit to donate that packet of food to a starving refugee.
Actually, no. Don't forget, that, yes, personal motivation is important, but the object of giving is much more important if we talk about merits. Some poor refugee is nothing in comparison with an arahant. It is like a glass of water in comparison with the limitless ocean. Or like a lone planet in comparison with a galaxy of billions of stars. And so the result of dana will differ this much as well - no matter what your motivation is (actually, there is a sutta
which tells that even bad personal motivation brings enourmous merit if dana was given to an arahant).
And also, there is another sutta - MN 142 - which tells that 4 bhikkhus (sangha) is even a better field than 1 arahant. So, yes, if you bring dana to the monastery with 4 monks or more (and they accept it), your merit is incalculable while merit gained from helping some poor guy is almost nothing.
However, here we should also mention one more thing - that is - difference between merits and personal qualities. Merits is a wordly thing and will make you feel good in samsara for quite a long period of time. However personal qualities is something which helps you to reach nibbana. Merits alone are not sufficient to reach nibbana, while personal qualities are. In this sense, yes, it is better to be kind and compassionate rather than egoistic and greedy (for merits), and yes, dana to some poor beggar can develop your kindness and compassion more than dana to some rich monastery. But your merits won't be so good if you keep ignoring dana to monks.