For one thing, http://haveibeenpwned.com is Australian, so not subject to US law. It might be illegal to access it in the US, but it's not illegal for it to exist.
I think donw was talking about the much more gray-area part of HIBP: obtaining the lists of leaked passwords, in order to hash each one and store the hashes.