It is legal to hang homosexuals in Iran.
Jews were legally killed as far as the Nazis were concerned.
Just become something is legal - in this case a wrong assertion because spying on citizens is against the constitution so it is illegal - does not mean that it complies with Human Rights.