mid-13c., "shelter for the needy," from Old French hospital, ospital "hostel, shelter, lodging" (Modern French hôpital), from Late Latin hospitale "guest-house, inn," noun use of neuter of Latin adjective hospitalis "of a guest or host" (as a noun, "a guest; the duties of hospitality"), from hospes (genitive hospitis) "guest; host;" see host (n.1).
The sense of "charitable institution to house and maintain the needy" in English is from early 15c.; the meaning "institution for sick or wounded people" is recorded by 1540s. The same word, contracted, is hostel and hotel. The sense shift in Latin from duties to buildings might have been via the common term cubiculum hospitalis "guest-chamber." The Latin adjective use continued in Old French, where ospital also could mean "hospitable" and ospitalite could mean "hospital."
Proto-Indo-European root meaning "stranger, guest, host," properly "someone with whom one has reciprocal duties of hospitality," representing "a mutual exchange relationship highly important to ancient Indo-European society" [Watkins]. But as strangers are potential enemies as well as guests, the word has a forked path.
The word ghos-ti- was thus the central expression of the guest-host relationship, a mutual exchange relationship highly important to ancient Indo-European society. A guest-friendship was a bond of trust between two people that was accompanied by ritualized gift-giving and created an obligation of mutual hospitality and friendship that, once established, could continue in perpetuity and be renewed years later by the same parties or their descendants. [Calvert Watkins, "American Heritage Dictionary of Indo-European Roots"]
It forms all or part of: Euxine; guest; hospice; hospitable; hospital; hospitality; hospodar; host (n.1) "person who receives guests;" host (n.2) "multitude;" hostage; hostel; hostile; hostility; hostler; hotel; Xenia; xeno-; xenon.
It is the hypothetical source of/evidence for its existence is provided by: Greek xenos "guest, host, stranger;" Latin hostis, in earlier use "a stranger," in classical use "an enemy," hospes "host;" Old Church Slavonic gosti "guest, friend," gospodi "lord, master;" Old English gæst, "chance comer, a stranger."