The context of this passage is talking about mammon (the love of, and the endless pursuit of, wealth). But the principle applies to everything else. There can only be one master in your life. You can only serve one thing at a time. You are not free to do as you please. Even if you say you serve no one, you are still serving Self. So which will it be? Jesus says if you love Him then you will hate everything else. What does that mean?
It means that you will allow nothing and no one to take the place of the One you love – not for a day, not for an hour, not for a minute. If our love for the Lord is strong then we will learn to hate everything which competes against Him. We will despise anything that seeks to hinder our relationship with Christ.