I was looking through Hagakure recently and found the following:

You cannot tell whether a person is good or bad by his vicissitudes in life. Good and bad are matters of fate. Good and bad actions are Man’s Way. Retribution of good and evil is taught simply as a moral lesson.

That reminded me a lot of Ecclesiastes 9:11.

I returned, and saw under the sun, that the race is not to the swift, nor the battle to the strong, neither yet bread to the wise, nor yet riches to men of understanding, nor yet favour to men of skill; but time and chance happeneth to them all.

So not only is being good its own reward, sometimes it is its only reward.