I'll explain that on two levels. Hakadosh Baruch Hu rewards those who do what is the proper way (thing) to do, even though they don't do it l'shem shomayim. If you work, that's what you should do. It's like eating; Hashem rewards those who eat, if you won't eat then you won't be able to live. If you eat you are rewarded that you live, even though you didn't eat l'shem shomayim. If you eat l'shem shomayim, you get more reward. You sit down at breakfast and say, I am now going to eat in order to have strength to serve my Creator. Is that hard to do? Try it tomorrow morning. It's a whole siman in Shulchan Aruch Orach Chaim. I am now going to eat in order to have strength to serve my Creator. That is even greater.
Therefore you get reward for working. If you go to work like a decent person – you don't say I'm sick, I'm too nervous to work, let my wife support me… That kind of fellow, Hashem doesn't like him at all. Hakadosh Baruch Hu doesn't like people that don't work. You have to work; let your wife stay home, there's plenty to do at home. She has to bake bread, she has to take care of the children; you go to work!
A man who doesn't work becomes sick – he becomes a nervous wreck, he becomes mentally disturbed.
Gedola melacha, how great is work! Work keeps you alive – it makes you healthy, it makes you mentally well! It's a big tragedy that people don't work as much as they once used to do. Once upon a time they worked all the time, except Shabbos. When Shabbos came they were weary, and they appreciated the rest. All week long they had no time for mischief! They worked from early morning till late at night. It's a blessing! Work is a blessing!
Gedola melacha, how great is work, in many ways it's great. Sh'mechabedes es baleha, it makes you respectable. You don't have to go beg, you have your own income. Gedola melacha sh'mechamemes es baleha, another ma'mar, it warms you up, you get exercise when you work, it keeps you healthy when you are working. There are other benefits of work. Certainly you must work. Even though you don't work l'shem shomayim you'll get reward, no question about it.
But when a person works l'shem shomayim, and he has in mind, after all he was mekabel kinyan on the kesubah when he married his wife, and he obligated himself to support her, and he has children to support, he's raising up ovdei Hashem, frum boys and girls, he has to pay schar limud. He has to feed them, he has to emulate Hashem, nosein lechem lkol bosor, Hashem feeds all the living. He also wants to feed his children like a messenger of Hashem, and he does it l'shem shomayim – no question this man who is working gets even more reward.
Therefore in two senses, does he earn reward for work? Absolutely. But of course if you work l'shem shomayim, you get a much greater reward.