Most often because the code was never real. Cheat sites are full of invented codes that get copied from one page to another without anyone testing them.
The other common reasons are mundane: the code belongs to a different region's version, it needs a specific button held while the level loads, or a patch has since removed it.
Before assuming the site is at fault, check the exact version and platform the code was written for. That single mismatch explains the majority of failures.