About the etymology: "Haram" in the sense of "harem" and "haram" in the sense of "religiously prohibited" are two different words, although closely etymologically related. The former's second vowel sound is short (ḥaram) while the latter's is long (ḥarām). Both derive from the Arabic root ḥ-r-m, which has two basic meanings: "to be forbidden/unlawful" and "to be sacred/inviolable." Thus the mosque in Mecca that houses the Kaaba is called the Masjid al-Ḥarām - the sacred mosque. So this twin meaning applies to the harem insofar as it is an inviolable space for women, unlawful for strange men to enter.
As an aside, I'd hesitate to characterize the harem as a chamber full of women possessed by the sultan. Yes, housing concubines for the sultan's sexual and reproductive purposes was one of the important functions of the harem institution, but it wasn't really its main day-to-day purpose. The harem was a parallel palace institution for the female half of the Ottoman dynasty. The female members of the family, or at least those who hadn't moved out of the palace for one reason or another, ruled over it and so most of its population consisted of their servants and retainers rather than concubines for the sultan. The point being that even if the sultan were asexual, the harem would still exist because of its fundamental function as the female component of the palace. "Harem" in fact was a general term that could refer to the female component of any house large enough to be divided into male and female sections. The Ottoman harem was referred to more specifically as as "the Imperial Harem" (harem-i hümâyûn).
As for why concubinage was permitted: it's simply the case that according to contemporary interpretations of Islamic Law, men who possessed female slaves were permitted to have sexual relations with them (willing or not), and their children would be regarded as their own legitimate children. All of the women with whom the sultans reproduced from the fifteenth through the eighteenth century were women of slave origin (I'm unsure of how this changed in the nineteenth and twentieth centuries).