He says this not to slaves alone, but also to free people, exhorting all Christians to do nothing for the sake of pleasing men and not to obey them if their commands are unlawful. This is what it means: having been bought by God, to become slaves of men. He is not urging slaves to fall away from their masters—no; this is clear from his subsequent words: "in whatever calling one was called," and so on, that is, if someone was called even in a state of slavery, let him remain in it. He added "before God" so that through obedience to lawless masters one would not fall away from God. He is concern...ed about both things, that is, on the one hand, that slaves not fall away from their masters under the pretext of obedience to God, and on the other, that by rendering excessive obedience to their masters, they not fall away from God.
Source: Commentary on 1 Corinthians