Illegal means it violates a law. A crime is something that actually harms someone.
Gay marriage may have been illegal, but it was never a crime, for example.
Alas, these days the USA is a very authoritarian culture and the idea that there might be US laws that are themselves crimes to enforce seems alien. But logically and morally it is the case.