Then when he says, but whatever gain I had, he shows his contempt for the prestige he had under the Law: first, he shows in general why he scorned the things of the Law; secondly, in detail (3:8).
He says, therefore: Whatever gain I had, i.e., prestige, namely, to be a Pharisee and so on, I counted as loss for the sake of Christ, i.e., I came to regard them as hindrances. For the observances of the Law, which were effective during the time of the Law, became harmful after Christ; hence he says, loss. And the reason for abandoning them was Christ; hence he says, for the sake of Christ.
Source: Commentary on Philippians