First of all, I acknowledge several flaws in my question - the generalization of an entire region, the lack of specificity with regards to time period and the very eurocentric way the question is posed. Sincere apologies. I am, however, in the process of doing some research for a (fantasy) Dungeons and Dragons campaign that I would like to be set in maritime, desert culture with strong Arabic influence. I am aware of the importance of centres of learning, but I was wondering whether someone could shed light on social gathering in public places throughout the Middle East and whether there is a tavern/inn equivalent to be found.
There are different places in different regions. As far as I can tell there are generally two patterns:
In the Arab world, I'm not exactly sure how this worked, but it was similar. In more tribal parts of Shi'a Iraq, for instance, there would be a whole separate guest building, the mudhif. It was where the men sociallized, and in holidays distant members of the tribe would come and visit and be served food, and during times of conflict, armed men would stay full time in mudhif so it'd almost become a barracks like thing. If you read one book to get a feel, I strongly recommend Fernea's Guests of the Sheik.
The local notables have a variety of names--in Turkey you'd get ağa/agha, here you get sheikh, in other parts of the Arab world you have 'ayan-- who are sort of like royalty but not quite. Usually the head of the most important family and this position was not determined by wealth alone nor by position give by a higher power, but by an armed folllowing. Meeker's Republic of Empire describes how the local notables in the his region of the Eastern Black Sea rose to power in the 18th century period of Ottoman decentralization, originally as little more than bandits (the incorporation of bandits has a long history in the Ottoman Empire, see Barkey's Bandits and Bureaucrats). In more tribally organized and nomadic parts of the Ottoman Empire, these local notables always existed.
Often, many of these might be sponsored or at least affiliated with a local notable of his party (Meeker has this going back to either the late 18th or early 19th), but as time went on, more and more coffee/tea houses opened, coffeeshops differed. I think by the 60's, Meeker describes how there are one or two teahouses (this is a tea producing region he's in) for each major party, plus one for the central bureaucrats and the elites by education (rather than family), and then a few more random ones. He also mentions how the local notable family actually does its family political business out of a semi-private backroom.
So, in short, rural areas, tribal areas, and other places with limited cash-market penetration tended to have a "guest room" where the local notable received guests. This could vary from as small place where the elders were respected but everyone had a similarly equal say (rotating through a couple of meager rooms in the village), to places controlled by local notables where one faction of the town would go but the other wouldn't and the poor weren't allowed to enter, to a whole separate outbuilding that could sleep a few hundred men (with the notable providing the bedding and food). In places with denser populations and more active market connections, you'd have a tea or coffeehouse. Often, one or two of these (and there may have only been one or two of these in the area) were controlled by local notables, but if the town was big enough, there would be others that were politically neutral. In big cities, there'd be coffee/teahouses associated with different regions, so (male) migrants from that region would go there to talk, see old friends, and get news of the place they left.
Women's sociability is different and very private, away from men, always in the private parts of the house. Fernea describes how she and her husband never spent anytime together when they visited friends--she barely even saw him when they went together. Fernea's account remains the best, though I've read Stirling's wife's unpublished account and she, as a westerner outside the system, was sometimes brought into the men's area alongside her husband (though her generally only at certain times). The Stirlings lived in a poorer area than the Ferneas, and as such the women's quarters were less elaborate. The Turks were also much more relaxed about gender division generally, and as such the Stirlings would see each other more out at bigger events like weddings, whereas Fernea says that she literally only would see her husband from across the courtyard while they were paying visits to friends (or, perhaps, in serving tea after a meal while guests were visiting their home). Fernea also describes how women wouldn't go by the market, so often would simply forgo visiting friends and relations on the other side of town (this was relevant in her town, because there was once a bridge over the river that went along the outskirts of town which was moved to the center next to the market; this meant that women from both sides of the river had a much harder time paying visits to one another).
In addition to these, there's also the Han (and it's bigger cousin, the caravanserai), but these were for travelers, particularly merchants, craftsmen, and farmers coming to market, not locals (one guy told me a great story of coming from his village to the city and staying in a Han while they were selling their harvest, I remember it because he described using his shoes as a sort of pillow--they were so poor back then, in the 1950's). In places I've looked at, these were centers of commercial transactions, not local sociability.