Notice the word “loss” and what Paul gained. Paul gained Christ. Each loss is pared with Christ.
Philippians 3:7-8 But whatever gain I had, I counted as loss for the sake of Christ. 8 Indeed, I count everything as loss because of the surpassing worth of knowing Christ Jesus my Lord. For his sake I have suffered the loss of all things and count them as rubbish, in order that I may gain Christ