My answer is more a gut-feel from Modern Greek practice, but I suspect it applies to antiquity as well. Dimitris Almyrantis perceptively identifies the (or at least an) underlying reason: avoidance of retribution. Cernowain Greenman identifies the surface reason: code of honour.
The modern Greek code of honour (How do I translate the Greek word filotimo?) also prominently features hospitality. The rationale that I intuit for it there is: it’s all about positive Face. If you can dispense largesse, you will be looked on as a valued member of the community: to be honourable consists of doing right by your fellow human, which means not only giving back (reciprocity), but also giving (generosity).
In that light, honour requires that you be hospitable, just as honour requires that you be diligent and responsible. (The reproach for a slack civil servant or a cheating tradesperson is that they are afilotimos, dishonourable.) You do good for others, not because you expect it in return, but because society as a whole benefits from it.
That’s consistent with Dimitris’ answer, which it ultimately derives from, and it’s a modern elaboration of Cernowain’s.