"because that prophet is a prophet" or "because he knows that that person is a prophet." That is, the one who welcomes will receive the reward because he knew that the person he was welcoming was a prophet.
"because that righteous man is a righteous man" or "because he knows that that person is righteous." That is, the one who welcomes will receive the reward because he knew that the person he was welcoming was a righteous man.