Even once you "own", a home, you still rent from .gov via taxes! Can they dictate what you keep there?
There you have stepped over the line......the Government can not restrict via the second amendment. What prevents the lenders is your right to not sign up for a mortgage like that. An interesting question would be about someone living in places like “the Projects” in the East, crime ridden places where the government is your landlord......What would stop them from putting something like a gun prohibition in the contract? Lenders have already expressed a willingness to refuse loans to manufacturers -- there's no reason they couldn't also refuse loans to owners.