Because Allah the Exalted has said: "And do not have intercourse with your wives while you are in retreat (i'tikaf) in the mosques. These are the limits set by Allah, so do not approach them. Thus Allah makes His commandments clear to the people so that they may guard themselves (from sin)."
Ibn Umar said: The Prophet ﷺ used to observe Itikaf during the last ten days of Ramadan. Nafi said: Abdullah (bin Umar) showed me the place in the mosque where Messenger of Allah ﷺ used to observe Itikaf.
Shaykh Umar Farooq Saeedi
Benefits and Issues: The mosque alone is the legislated and Sunnah place for i‘tikaf (spiritual retreat), as the Noble Qur’an has mentioned: (And do not have relations with them while you are in i‘tikaf in the mosques) (: al-Baqarah: 187), and as long as you are in i‘tikaf in the mosques, do not approach your wives.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 2465
´It was narrated from ‘Abdullah bin ‘Umar that:` The Messenger of Allah (ﷺ) used to spend the last ten days of Ramadan in I’tikaf. Nafi' said: " Abdullah bin 'Umar showed me the place where the Messenger of Allah (ﷺ) used to observe I'tikaf."
Maulana Ataullah Sajid
Benefits and Issues:
➊ Although i‘tikaf means to remain in the mosque, it is understood from the Sunnah that even within the mosque, a specific place should be designated, and the time of i‘tikaf should be spent in that very spot.
➋ The purpose of setting up a partitioned area for i‘tikaf is also so that as much time as possible is spent in that tent.
➌ If a person performs i‘tikaf every year in the same part of the mosque, this is permissible, whereas it is not correct to designate a specific place in the mosque for prayer. In the home, this is also permissible.
Source: Commentary on Sunan Ibn Mājah by Mawlānā ‘Atā’ullāh Sājid, Page: 1773