If I'm reading Wikipedia correctly (and their info is correct), this may indeed be legal:
"...A current U.S. law that definitely has an ex post facto effect is the Adam Walsh Child Protection and Safety Act of 2006. This law, which imposes new registration requirements on convicted sex offenders, gives the U.S. Attorney General the authority to apply the law retroactively. [1] However, the U.S. Supreme Court has already ruled in Smith v. Doe (2003) that forcing sex offenders to register their whereabouts at regular intervals, and the posting of personal information about them on the Internet, does not violate the constitutional prohibition against ex post facto laws, because compulsory registration of offenders who completed their sentences before new laws requiring compliance went into effect does not constitute a punishment. [2]"
As despicable as this crime is, there should be no abridgement of our legal protections under the Constitution and Common Law.
This will appear before SCOTUS again when a convicted sex offender. who has completed his sentence, refuses to register. The Court will have to go beyond Smith v Doe and ask if sanctions against refusers are an example of enforcing an ex post facto law.
Telling people where they may live, based on their sex-offender status, constitutes a punishment. If applied retroactively, it's ex post facto.