This reminds one of 1 Samuel 30:24: that the soldiers given unglamorous assignments should be rewarded like the headliners.
There's a lot in that little sentence. The world is made with friction and disintegrating forces, so that a thing once made is not made forever; it must be maintained and sometimes even remade.
Those of us who merely maintain the garden are co-creators of the garden with the ones who made it in the first place. We have the honor of participating in its creation, through its maintenance: two sides of a coin.
OK, I'm not a prophet (though one never knows), but if I welcome a prophet and put the word given him into action, I join with him in his work and share in his reward.
Even if I didn't think of it myself, if I help that "righteous man", encourage and honor him (or her--I can think of many), I participate in their righteous work.
We're one body in the church in Christ. When one part hurts, all do; when one is honored, all are.
Jesus' statement is apparently even broader than just that. After all, not all who "receive a righteous man" are members of that body. But perhaps verse 40 gives encouraging context: "He who receives you receives Me, and he who receives Me receives Him who sent Me." If they receive His missionaries they receive Him, and even if they only receive a righteous man they are on the road to receiving Him.
But notice--the welcomer is not claiming equal honor with the prophet.