mid-15c., "bedroom, bedchamber," from Latin cubiculum "bedroom," from cubare "to lie down," which is perhaps from a PIE *kub-, with cognates in Middle Welsh kyscu, Middle Cornish koska, Middle Breton cousquet "to sleep," but de Vaan regards the PIE origin of the Latin word as "uncertain." Compare cubit.
Obsolete from 16c. but revived by 1858 for "dormitory sleeping compartment," especially in an English public school. The sense of "any partitioned space" (such as a library carrel or, later, office work station) is attested by 1926. Related: Cubicular.
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."
late 14c., "a small private room for study or prayer," from Old French closet "small enclosure, private room," diminutive of clos "enclosure," from Latin clausum "closed space, enclosure, confinement," from neuter past participle of claudere "to shut" (see close (v.)).
In Matthew vi.6 it renders Latin cubiculum "bedchamber, bedroom," Greek tamieion "chamber, inner chamber, secret room." Modern sense of "small side-room for storage" is first recorded 1610s.
The adjective is from 1680s, "private, done in seclusion;" from 1782 as "fitted only for scholarly seclusion, not adopted to the conditions of practical life." The meaning "secret, not public, unknown" is recorded from 1952, first of alcoholism but by 1970s used principally of homosexuality; the phrase come out of the closet "admit something openly" is first recorded 1963, and lent a new meaning to the word out.