I think SCOTUS punted on this one. IMO anyone who molests kids should be under lifetime sanction and supervision, with hanging by piano wire one treatment option. However, IMO the Megan's Laws are a pretty clear ex post facto sentence - additional sanction imposed by law after conviction - we should change the laws going forward to deal with this problem and not disregard the constitution in doing such. Serious usurpation of rights always starts with actions against undesirables such as pervs and drug addicts - but eventually spreads to all of us.
People don't realize they're on a slippery slope until they notice they're wearing skis.
This is not an ex post facto issue. It's simply saying that imprisonment is part, but not all, of the price one has to pay upon conviction of this particular crime. There are additional sanctions. Think of people who are jailed and have to pay a fine, or have to stay on parole after being freed.
The prohibition in the Constitution against ex post facto laws addresses another phenomena entirely; being tried and punished for an offense that was committed before the offense was illegal. Say a law is passed making it illegal to buy "A", it's effective immediately upon the Governor's signature, and he or she signs it tomorrow. You can be arrested if you buy "A" the day after, but you can't be arrested if you bought "A" yesterday. The latter would be an ex post facto proceeding. Any law that stated that "Anyone who bought 'A' in the last two years has broken the law" would be an ex post facto law and would be unconstitutional.