You should not practice Buddha’s teaching with the idea of gain.
... how should we proceed? Proceed with the mind which neither grasps nor rejects, the mind unconcerned with name or gain. Do not practice buddha-dharma with the thought that it is to benefit others.
...
Clearly, buddha-dharma is not practiced for one’s own sake, and even less for the sake of fame and profit. Just for the sake of buddha-dharma you should practice it.
All buddhas’ compassion and sympathy for sentient beings are neither for their own sake nor for others. It is just the nature of buddha-dharma. Isn’t it apparent that insects and animals nurture their offspring, exhausting themselves with painful labors, yet in the end have no reward when their offspring are grown? In this way the compassion of small creatures for their offspring naturally resembles the thought of all buddhas for sentient beings ...
Students! Do not practice buddha-dharma for your own sake. Do not practice buddha-dharma for name and gain. Do not practice buddha-dharma to attain miraculous effects. Practice buddha-dharma solely for the sake of buddha-dharma. This is the way.