There’s a law called HOPA that says it’s legal. You can have white only neighborhoods if you have the laws, until someone challenges them, changes them, etc. There’s a specific allowance for old people and nobody wants to take it away enough to have changed it.
It’s definitely more federal than something like our roads. Fair Housing is a civil rights era law that is federal, and HOPA is a modification to those older laws. I don’t know how a state would break that, or if it’s reasonably possible.
All I meant by the white neighborhood thing is to say that contradictions in laws only matter if you challenge them, and it’s unlikely people will want to “fix” this law when it’s aimed at helping old people, especially ones who are sick or close to death.