We must cultivate the virtues and do all virtuous deeds, this is
a way of cultivating our blessings. However if we are attached to
the fruits of the actions, or the act itself, then it cannot be
considered as Merits anymore. Real Merits come from Dharmakaya, it
comes from spontaneity and naturalness, non-arising is 'Gong',
non-cessation is 'De'. Therefore my taiwanese teacher said - to an
enlightened person, everything he does creates merits.
My Shi Fu, Master Shen Kai says - Merits are consequences of the non-orignation
and non-cessation of the mind. During the Tang Dynasty in ancient
China, Emperor Liang Wu-Ti asked the patriarch Bodhidharma,
"Venerable One, I have built many monasteries for the well being of
the Sangha and I have also performed many virtuous deeds. What
merits have I accumulated? Bodhidharma answered, "You have no
merits." Why is that so? It is because when Emperor Liang Wu-Ti
performed those acts of giving, he was attached to them. Thus, even
though he had performed many virtuous deeds, because he had not
cultivated the purity of his mind, he did not attain
"non-origination and non-cessation". Therefore, his actions can
only be considered as cultivation of blessings, not merits. Without
liberation there are no merits. On the other hand, when there is
liberation, all virtuous deeds will reap merits.
More info that can also be found in Platform Sutra, Chapter 3,
Q&A answered by the 6th Zen Patriarch Hui Neng.
Furthermore... if we give with expectations of getting something in
return, it can only be called 'Leaking Blessings', and the results
is very little compared to true merits.