Sure it’s legal. It’s private property owner so it’s not a second amendment issue (Bill of Rights is a restriction on government activity not private activity) and gun owners are not a protected class so there is no equal protection violation. It does sound like a pretty good business opportunity though. If I owned an apartment building in the area I would happily advertise, “We welcome gun owners.” Not only would they get plenty of renters, but it would probably be the safest place to live in the whole state.
Oops, after reading the thread I see that there’s a government component, in which case the ban would not be legal.