Of course. Question is, is the housing at least partly a chattel of the government? If it is, then the government can reasonably make rules about what can be done in the housing, along the lines of what a private apartment can enforce. It would be in the lease. They couldn’t do something like bar Democrats or Republicans, of course. But maybe they could bar the cooking of very stinky food or the burning of very stinky incense.
Post 21 is addressed to you also.