He declared Cao's term illegal because it was obtained through bribery and also repudiated the agreement which allowed Puyi to live in the Forbidden City.
Because it was obtained through bribery. This was what he declared Cao's term illegal. He also repudiated the agreement. This agreement allowed Puyi to live in the Forbidden City.