Context for Alma’s discourse: These verses describe prayer locations that are individualized, rather than communal. The typical Mesoamerican farmer’s home would not have had any internal structure that offered privacy. However, the requirement is more for a private place than for a structure. Perhaps in the Mesoamerican context, it referred to a household shrine which would have been a location of worship inside the home. (See commentary accompanying Alma 32:5.) In any case, Zenos would still be making Alma’s point that worship does not depend on being present at the formal religious center in the city.
Reference: Joseph Smith probably borrowed the language of “closet” from Matthew 6:6: “But thou, when thou prayest, enter into thy closet, and when thou hast shut thy door, pray to thy Father which is in secret; and thy Father which seeth in secret shall reward thee openly.” M. G. Easton notes that “as used in the New Testament, [closet] signifies properly a storehouse (Luke 12:24), and hence a place of privacy and retirement (Matt. 6:6, Luke 12:3).”