Paul is explaining that yes we are saved by grace through faith because of Christ's faithfulness (Phil 3:9), but goes on to emphasize continuing in that (Phil 3:12). He's not contradicting himself.
He's already explained that works righteousness is dung to him. But in Christ we are perfect, yet because we live in this world not yet perfect. We continue to strive upward.
The reality is that people, being the knuckleheads that we are, would take our liberty, our righteousness in Christ, and use it as an excuse to sin.
Romans 6:1 What shall we say then? Shall we continue in sin, that grace may abound?
Recall with Thessalonica how some brothers interpreted their salvation to sit by in idle.
2 Thess. 3:6, 11 Now we command you, brethren, in the name of our Lord Jesus Christ, that ye withdraw yourselves from every brother that walketh disorderly, and not after the tradition which he received of us. ... For we hear that there are some which walk among you disorderly, working not at all, but are busybodies.
Or recall the messes at Corinth and elsewhere.
It's a fine line to know you have no righteousness but in Christ's and to work at that, rather than be what you were or take advantage of that.
PS As regards the tri-theology of justification, sanctification, and washing, Paul is applying the same idea in Philippians as he did in Corinthians. Bold my emphasis.
1 Cor. 6:11 And such were some of you: but ye are washed, but ye are sanctified, but ye are justified in the name of the Lord Jesus, and by the Spirit of our God.
Justified is "to be made right or righteous". Passive voice. It is done to you.
Sanctified is "to be made holy or set aside". Passive voice. It is done to you.
Washed is "your visible testimony to the internal spiritual change (born-again as justified and sanctified)". Middle voice. Something you do and continue to do.
So again, the idea is simply that you are saved by grace in Christ's righteousness, not your own, but your appearance matters also. It's like a bath and being a zillionaire. Just because one is rich doesn't mean one should ignore his outward appearance and its influence.
As an aside to try to explain what happened, I'd suggest that somewhere along the line the idea of water baptism (washing) as salvific became like justification, as a one-time occurrence; thus rendering the necessity of your working for sanctification. Instead, one was a sinner, but upon salvation one is justified and is sanctified (done to you), but you must still walk the earth, not quite finished and thus not requiring your washing yourself with the word, Spirit, etc.