فَٱنطَلَقَا حَتَّىٰٓ إِذَآ أَتَيَآ أَهْلَ قَرْيَةٍ ٱسْتَطْعَمَآ أَهْلَهَا فَأَبَوْا۟ أَن يُضَيِّفُوهُمَا فَوَجَدَا فِيهَا جِدَارًا يُرِيدُ أَن يَنقَضَّ فَأَقَامَهُۥ ۖ قَالَ لَوْ شِئْتَ لَتَّخَذْتَ عَلَيْهِ أَجْرًا Qur’an Al-Kahf (18:77)Fa i n t alaq a h att a i tha atay a ahla qaryatin ista t AAam a ahlah a faabaw an yu d ayyifoohum a fawajad a feeh a jid a ran yureedu an yanqa dd a faaq a mahu q a la law shita la i ttakha th ta AAalayhi ajr a n
Lit., "asked its people".
As they were refused hospitality, they should, as self-respecting men, have shaken the dust of the town off their feet, or shown their indignation in some way. Instead of that, Khidhr actually goes and does a benevolent act. He rebuilds for them a falling wall, and never asks for any compensation for it. Perhaps he employed local workmen for it and paid them wages, thus actually benefiting a town which had treated him and his companion so shabbily! Moses is naturally surprised and asks, "Could you not at least have asked for the cost?"
The inhabitants were churlish. They broke the universal Eastern rule of hospitality to strangers, and thus showed themselves beyond the pale of ordinary human courtesies. Note that they would have been expected to offer hospitality of themselves, unasked. Here Moses and his companion actually had to ask for hospitality and were refused point-blank.