The answer to your first question is a bit complicated, so I'll try my best to explain. Replicants are not robots in the sense that they are strictly programmable by 0s and 1s. They are more or less genetically enhanced humans. When they say Nexus 9s are "built to obey and never rebel", that's not entirely accurate. Nexus 9s operate on the basis of a brainwashing mechanism, which is done using the "Baseline Test". After a traumatic experience, Nexus 9s are required to take this test, in order to make sure they stay robot-like and obedient, and not start developing human emotions. This is a rather effective mean for brainwashing.
Now, when K realized that he was the child, he suddenly had the idea that he is not a Nexus 9, and that he had been brainwashed all along. This infuriating realization thrust him into the mood for rebellion. Besides, he had to lie anyways, because if the LAPD knew he was the child, they would kill him.
The answer to your second question is fairly simple. The Replicant Freedom Movement is lead by older models, not Nexus 9s. As such, they are all fugitives because they are not "built to obey", and are considered hazardous. Remember, replicants were banned following the Blackout, so only Nexus 9s are legal, since they were introduced by Wallace and can be trusted. Or can they? ;)