Indeed, the Adam Walsh law does sound like bad law. Yes, most of us aren't too thrilled with the idea of 52 year old men having sexual relationships with 16-year olds (not accusing Foley here - there's no evidence available that says he actually did), and yes the custodial relationship between Foley on the pages makes the possibility even worse.
But, still, however improper such relationships are there's a reason that they aren't necessarily criminal. Statutory rape laws deny agency to people, they say that aren't capable of making decisions about their own bodies. That's fine up to a point, but there are limits and I personally am quite uncomfortable setting the age of consent above 16 generally, though I'm happy to increase it when custodial relationships (teachers, coaches, bosses of minor employees, etc...) are involved.
And, obviously, if the sex isn't illegal it's a bit weird that soliciting sex is illegal.
Still, while I don't like denying people agency, I also recognize that parents of minors still have authority, which is why rather than criminalizing all such relationships - the prosecution of which isn't good in all cases for the minors in question - having structures in place which allow parents to invoke state authority to intervene in such relationships if they deem it necessary is desirable.
I shouldn't have to say it, but whether it is or should be legal or not Foley's behavior was highly inappropriate.